@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 PDOMCPPParameter(
      PDOMLinkage linkage, PDOMNode parent, ICPPParameter param, PDOMCPPParameter next)
      throws CoreException {
    super(linkage, parent, param.getNameCharArray());
    fType = null; // This constructor is used for adding parameters to the database, only.
    fDefaultValue = param.getDefaultValue();

    Database db = getDB();
    linkage.storeValue(record + DEFAULT_VALUE, fDefaultValue);
    db.putRecPtr(record + NEXT_PARAM, next == null ? 0 : next.getRecord());

    storeAnnotations(db, param);
  }
  @Override
  public void forceDelete(PDOMLinkage linkage) throws CoreException {
    getDBName().delete();
    linkage.storeType(record + DEFAULT_TYPE, null);

    final Database db = getDB();
    long oldRec = db.getRecPtr(record + PARAMETERS);
    IPDOMCPPTemplateParameter[] oldParams = getTemplateParameters();
    if (oldRec != 0) db.free(oldRec);
    for (IPDOMCPPTemplateParameter opar : oldParams) {
      opar.forceDelete(linkage);
    }
  }
 private void flatDelete(PDOMLinkage linkage) throws CoreException {
   linkage.storeValue(record + DEFAULT_VALUE, null);
   super.delete(linkage);
 }
 protected void setType(final PDOMLinkage linkage, IType newType) throws CoreException {
   linkage.storeType(record + TYPE_OFFSET, newType);
 }