libSBML C API  5.18.0
Deletion_t Class Reference

Detailed Description

comp Deletion of an object from a submodel.

The Deletion_t class was introduced by the SBML Level 3 Hierarchical Model_t Composition (“comp”) package to allow elements of submodels to be removed before instantiation.

The Deletion_t object class is used to define a deletion operation to be applied when a submodel instantiates a model definition. Deletions may be useful in hierarchical model composition scenarios for various reasons. For example, some components in a submodel may be redundant in the composed model, perhaps because the same features are implemented in a different way in the new model.

Deletions function as follows. When the Model_t to which the Submodel_t object refers (via the "modelRef" attribute) is read and processed for inclusion into the composed model, each Deletion_t object identifies an object to remove from that Model_t instance. The resulting submodel instance consists of everything in the Model_t object instance minus the entities referenced by the list of Deletion_t objects.

As might be expected, deletions can have wide-ranging implications, especially when the object deleted has substantial substructure, as in the case of reactions. The following are rules regarding deletions and their effects.

  • An object that has been deleted is considered inaccessible. Any element that has been deleted (or replaced) may not be referenced by an SBaseRef_t object.
  • If the deleted object has child objects and other structures, the child objects and substructure are also considered to be deleted.
  • It is not an error to delete explicitly an object that is already deleted by implication (for example as a result of the second point above). The resulting model is the same.
  • If the deleted object is from an SBML namespace that is not understood by the interpreter, the deletion must be ignored—the object will not need to be deleted, as the interpreter could not understand the package. If an interpreter cannot tell whether a referenced object does not exist or if exists in an unparsed namespace it may produce a warning.

The Deletion_t object class is subclassed from SBaseRef_t, and reuses all the machinery provided by SBaseRef_t. In addition, it defines two optional attributes, "id" and "name". The "id" attribute can be used to give an identifier to a given deletion operation. The identifier has no mathematical meaning, but it may be useful for creating submodels that can be manipulated more directly by other submodels. (Indeed, it is legitimate for an enclosing model definition to delete a deletion!)

The optional "name" attribute is provided on Deletion_t for the same reason it is provided on other elements that have identifiers; viz., to provide for the possibility of giving a human-readable name to the object. The name may be useful in situations when deletions are displayed to modelers.

Public Member Functions

Deletion_tDeletion_clone (Deletion_t *d)
 Returns a copy of the given Deletion_t structure. More...
 
Deletion_tDeletion_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new Deletion_t structure using the given SBML level and version, and the pkgVersion package version. More...
 
void Deletion_free (Deletion_t *d)
 Frees the given Deletion_t structure. More...
 
char * Deletion_getId (Deletion_t *d)
 Takes an Deletion_t structure and returns its identifier. More...
 
char * Deletion_getName (Deletion_t *d)
 Takes a Deletion_t structure and returns its name. More...
 
int Deletion_hasRequiredAttributes (Deletion_t *d)
 Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes for the given Deletion_t structure have been set. More...
 
int Deletion_isSetId (Deletion_t *d)
 Predicate returning 1 (true) or 0 (false) depending on whether the given Deletion_t structure's identifier is set. More...
 
int Deletion_isSetName (Deletion_t *d)
 Predicate returning 1 (true) or 0 (false) depending on whether the given Deletion_t structure's name is set. More...
 
int Deletion_setId (Deletion_t *d, const char *sid)
 Assigns the identifier of an Deletion_t structure. More...
 
int Deletion_setName (Deletion_t *d, const char *name)
 Sets the name of the given Deletion_t to a copy of name. More...
 
int Deletion_unsetId (Deletion_t *d)
 Unsets the "id" attribute of the given Deletion_t structure. More...
 
int Deletion_unsetName (Deletion_t *d)
 Unsets the "name" attribute of the given Deletion_t structure. More...
 

Member Function Documentation

Deletion_t * Deletion_clone ( Deletion_t d)

Returns a copy of the given Deletion_t structure.

Parameters
dthe Deletion_t structure to copy.
Returns
a (deep) copy of the Deletion_t.
Deletion_t * Deletion_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new Deletion_t structure using the given SBML level and version, and the pkgVersion package version.

Parameters
levelan unsigned int, the SBML Level to assign to this Deletion_t.
versionan unsigned int, the SBML Version to assign to this Deletion_t.
pkgVersionan unsigned int, the SBML 'comp' package Version to assign to this Deletion_t.
Returns
a pointer to the newly created Deletion_t structure.
void Deletion_free ( Deletion_t d)

Frees the given Deletion_t structure.

Parameters
dthe Deletion_t structure to free.
char * Deletion_getId ( Deletion_t d)

Takes an Deletion_t structure and returns its identifier.

Parameters
dthe Deletion_t structure whose identifier is sought.
Returns
the identifier of the given Deletion_t, as a pointer to a string.
char * Deletion_getName ( Deletion_t d)

Takes a Deletion_t structure and returns its name.

Parameters
dthe Deletion_t whose name is sought.
Returns
the name of the given Deletion_t, as a pointer to a string.
int Deletion_hasRequiredAttributes ( Deletion_t d)

Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes for the given Deletion_t structure have been set.

Note
The required attributes for a Deletion_t structure are that it uses exactly one attribute to refer to its target.
int Deletion_isSetId ( Deletion_t d)

Predicate returning 1 (true) or 0 (false) depending on whether the given Deletion_t structure's identifier is set.

Parameters
dthe Deletion_t structure to query.
Returns
1 (true) if the "id" attribute of the given Deletion_t structure is set, 0 (false) otherwise.
int Deletion_isSetName ( Deletion_t d)

Predicate returning 1 (true) or 0 (false) depending on whether the given Deletion_t structure's name is set.

Parameters
dthe Deletion_t structure to query.
Returns
1 (true) if the "name" attribute of the given Deletion_t structure is set, 0 (false) otherwise.
int Deletion_setId ( Deletion_t d,
const char *  sid 
)

Assigns the identifier of an Deletion_t structure.

This makes a copy of the string passed in the parameter sid.

Parameters
dthe Deletion_t structure to set.
sidthe string to use as the identifier.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with an sid of NULL is equivalent to unsetting the "id" attribute.
int Deletion_setName ( Deletion_t d,
const char *  name 
)

Sets the name of the given Deletion_t to a copy of name.

Parameters
dthe Deletion_t structure to set.
namethe name to assign to the given Deletion_t's "name" attribute.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int Deletion_unsetId ( Deletion_t d)

Unsets the "id" attribute of the given Deletion_t structure.

Parameters
dthe Deletion_t structure to unset.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Deletion_unsetName ( Deletion_t d)

Unsets the "name" attribute of the given Deletion_t structure.

Parameters
dthe Deletion_t structure to unset.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: