@Override public void update(PDOMLinkage linkage, IBinding newBinding) throws CoreException { if (newBinding instanceof ICPPTemplateTemplateParameter) { final Database db = getDB(); ICPPTemplateTemplateParameter ttp = (ICPPTemplateTemplateParameter) newBinding; updateName(newBinding.getNameCharArray()); IType newDefault = null; try { newDefault = ttp.getDefault(); } catch (DOMException e) { // ignore } if (newDefault != null) { linkage.storeType(record + DEFAULT_TYPE, newDefault); } long oldRec = db.getRecPtr(record + PARAMETERS); IPDOMCPPTemplateParameter[] oldParams = getTemplateParameters(); try { params = PDOMTemplateParameterArray.createPDOMTemplateParameters( getLinkage(), this, ttp.getTemplateParameters()); long newRec = PDOMTemplateParameterArray.putArray(db, params); db.putRecPtr(record + PARAMETERS, newRec); if (oldRec != 0) db.free(oldRec); for (IPDOMCPPTemplateParameter opar : oldParams) { opar.forceDelete(linkage); } } catch (DOMException e) { } } }
public PDOMCPPTemplateTemplateParameter( PDOMLinkage linkage, PDOMNode parent, ICPPTemplateTemplateParameter param) throws CoreException, DOMException { super(linkage, parent, param.getNameCharArray()); final Database db = getDB(); int id = param.getParameterID(); if (param.isParameterPack()) { id |= PACK_BIT; } db.putInt(record + PARAMETERID, id); final ICPPTemplateParameter[] origParams = param.getTemplateParameters(); final IPDOMCPPTemplateParameter[] params = PDOMTemplateParameterArray.createPDOMTemplateParameters(linkage, this, origParams); long rec = PDOMTemplateParameterArray.putArray(db, params); getDB().putRecPtr(record + PARAMETERS, rec); }