libSBML C API
5.18.0
|
The SBaseRef_t class was introduced by the SBML Level 3 Hierarchical Model_t Composition (“comp”) package as the principle way by which submodel elements may be referenced. The SBaseRef_t class is usually found as the base class of a Port_t, Deletion_t, ReplacedElement_t, or ReplacedBy_t class, but may appear as an child of one of the above classes if the parent object references a Submodel_t.
An SBaseRef_t object must reference an element using exactly one of the optional attributes of the class. Subclasses of SBaseRef_t may define additional optional attributes that are legal ways to reference an element.
SBaseRef_t objects may reference elements that do not live in the Model_t parent of the SBaseRef_t object. However, the SBaseRef_t class itself does not provide a method of determining which Model_t or Submodel_t is being referenced. The subclasses of SBaseRef_t provide methods for this instead.
Once the Model_t to which the SBaseRef_t object is referencing has been established, there are four optional attributes defined in the SBaseRef_t class that are each methods of referencing an element:
PortSIdRef
): As its name implies, this attribute is used to refer to a port identifier, in the case when the reference being constructed with the SBaseRef_t is intended to refer to a port on a submodel. The namespace of the PortSIdRef
value is the set of identifiers of type PortSId
defined in the submodel, not the parent model. SIdRef
): As its name implies, this attribute is used to refer to a regular identifier (i.e., the value of an "id" attribute on some other object), in the case when the reference being constructed with the SBaseRef_t is intended to refer to an object that does not have a port identifier. The namespace of the SIdRef
value is the set of identifiers of type SId defined in the submodel, not the parent model. UnitSIdRef
): This attribute is used to refer to the identifier of a UnitDefinition_t object. The namespace of the UnitSIdRef
value is the set of unit identifiers defined in the submodel, not the parent model. (Note that even though this attribute is of type UnitSIdRef
, the reserved unit identifiers that are defined by SBML Level 3 (see Section 3.1.10 of the core specification) are *not* permitted as values of "unitRef". Reserved unit identifiers may not be replaced or deleted.) IDREF
): This attribute is used to refer to a "metaid" attribute value on some other object, in the case when the reference being constructed with the SBaseRef_t is intended to refer to an object that does not have a port identifier. The namespace of the "metaIdRef" value is the entire document in which the referenced model resides, but must refer to a subelement of the referenced model. Since meta identifiers are optional attributes of SBase_t, all SBML objects have the potential to have a meta identifier value.An SBaseRef_t object may have up to one subcomponent named "sBaseRef", of type SBaseRef_t. This permits recursive structures to be constructed so that objects inside submodels can be referenced.
The form of such recursive references must be as follows. The highest-level SBaseRef_t object of such a chain (which will necessarily be an object of class Port_t, Deletion_t, ReplacedElement_t or ReplacedBy_t, because they are the only classes derived from the class SBaseRef_t) must refer to a Submodel_t object in the containing model. All child SBaseRef_t objects in the chain must refer to components inside the Model_t instance to which the Submodel_t refers.
Public Member Functions | |
SBaseRef_t * | SBaseRef_clone (SBaseRef_t *sbr) |
Returns a copy of the given SBaseRef_t structure. More... | |
SBaseRef_t * | SBaseRef_create (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new SBaseRef_t structure using the given SBML level and version , and the pkgVersion package version. More... | |
void | SBaseRef_free (SBaseRef_t *sbr) |
Frees the given SBaseRef_t structure. More... | |
char * | SBaseRef_getIdRef (SBaseRef_t *sbr) |
Takes a SBaseRef_t structure and returns its idRef. More... | |
char * | SBaseRef_getMetaIdRef (SBaseRef_t *sbr) |
Takes a SBaseRef_t structure and returns its metaIdRef. More... | |
char * | SBaseRef_getPortRef (SBaseRef_t *sbr) |
Takes a SBaseRef_t structure and returns its portRef. More... | |
SBaseRef_t * | SBaseRef_getSBaseRef (SBaseRef_t *sbr) |
Takes a SBaseRef_t structure and returns its child SBaseRef_t, or NULL if no such child exists. More... | |
char * | SBaseRef_getUnitRef (SBaseRef_t *sbr) |
Takes a SBaseRef_t structure and returns its unitRef. More... | |
int | SBaseRef_hasRequiredAttributes (SBaseRef_t *sbr) |
Predicate returning true or false depending on whether all the required attributes for the given SBaseRef_t structure have been set. More... | |
int | SBaseRef_isSetIdRef (SBaseRef_t *sbr) |
Predicate returning 1 (true) or 0 (false) depending on whether the given SBaseRef_t structure's idRef is set. More... | |
int | SBaseRef_isSetMetaIdRef (SBaseRef_t *sbr) |
Predicate returning 1 (true) or 0 (false) depending on whether the given SBaseRef_t structure's metaIdRef is set. More... | |
int | SBaseRef_isSetPortRef (SBaseRef_t *sbr) |
Predicate returning 1 (true) or 0 (false) depending on whether the given SBaseRef_t structure's portRef is set. More... | |
int | SBaseRef_isSetSBaseRef (SBaseRef_t *sbr) |
Predicate returning 1 (true) or 0 (false) depending on whether the given SBaseRef_t structure's child SBaseRef_t is set. More... | |
int | SBaseRef_isSetUnitRef (SBaseRef_t *sbr) |
Predicate returning 1 (true) or 0 (false) depending on whether the given SBaseRef_t structure's unitRef is set. More... | |
int | SBaseRef_setIdRef (SBaseRef_t *sbr, const char *idRef) |
Sets the idRef of the given SBaseRef_t to a copy of idRef . More... | |
int | SBaseRef_setMetaIdRef (SBaseRef_t *sbr, const char *metaIdRef) |
Sets the metaIdRef of the given SBaseRef_t to a copy of metaIdRef . More... | |
int | SBaseRef_setPortRef (SBaseRef_t *sbr, const char *portRef) |
Sets the portRef of the given SBaseRef_t to a copy of portRef . More... | |
int | SBaseRef_setSBaseRef (SBaseRef_t *parent, SBaseRef_t *child) |
Sets the child SBaseRef_t of the parent SBaseRef_t to a copy of child . More... | |
int | SBaseRef_setUnitRef (SBaseRef_t *sbr, const char *unitRef) |
Sets the unitRef of the given SBaseRef_t to a copy of unitRef . More... | |
int | SBaseRef_unsetIdRef (SBaseRef_t *sbr) |
Unsets the "idRef" attribute of the given SBaseRef_t structure. More... | |
int | SBaseRef_unsetMetaIdRef (SBaseRef_t *sbr) |
Unsets the "metaIdRef" attribute of the given SBaseRef_t structure. More... | |
int | SBaseRef_unsetPortRef (SBaseRef_t *sbr) |
Unsets the "portRef" attribute of the given SBaseRef_t structure. More... | |
int | SBaseRef_unsetSBaseRef (SBaseRef_t *sbr) |
Removes the SBaseRef_t child of the given SBaseRef_t structure. More... | |
int | SBaseRef_unsetUnitRef (SBaseRef_t *sbr) |
Unsets the "unitRef" attribute of the given SBaseRef_t structure. More... | |
SBaseRef_t * SBaseRef_clone | ( | SBaseRef_t * | sbr | ) |
Returns a copy of the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to copy. |
SBaseRef_t * SBaseRef_create | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new SBaseRef_t structure using the given SBML level
and version
, and the pkgVersion
package version.
level | an unsigned int, the SBML Level to assign to this SBaseRef_t. |
version | an unsigned int, the SBML Version to assign to this SBaseRef_t. |
pkgVersion | an unsigned int, the SBML 'comp' package Version to assign to this SBaseRef_t. |
void SBaseRef_free | ( | SBaseRef_t * | sbr | ) |
Frees the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to free. |
char * SBaseRef_getIdRef | ( | SBaseRef_t * | sbr | ) |
Takes a SBaseRef_t structure and returns its idRef.
sbr | the SBaseRef_t whose idRef is sought. |
char * SBaseRef_getMetaIdRef | ( | SBaseRef_t * | sbr | ) |
Takes a SBaseRef_t structure and returns its metaIdRef.
sbr | the SBaseRef_t whose metaIdRef is sought. |
char * SBaseRef_getPortRef | ( | SBaseRef_t * | sbr | ) |
Takes a SBaseRef_t structure and returns its portRef.
sbr | the SBaseRef_t whose portRef is sought. |
SBaseRef_t * SBaseRef_getSBaseRef | ( | SBaseRef_t * | sbr | ) |
Takes a SBaseRef_t structure and returns its child SBaseRef_t, or NULL
if no such child exists.
sbr | the SBaseRef_t whose child SBaseRef_t is sought. |
NULL
if no such child exists. char * SBaseRef_getUnitRef | ( | SBaseRef_t * | sbr | ) |
Takes a SBaseRef_t structure and returns its unitRef.
sbr | the SBaseRef_t whose unitRef is sought. |
int SBaseRef_hasRequiredAttributes | ( | SBaseRef_t * | sbr | ) |
Predicate returning true
or false
depending on whether all the required attributes for the given SBaseRef_t structure have been set.
int SBaseRef_isSetIdRef | ( | SBaseRef_t * | sbr | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given SBaseRef_t structure's idRef is set.
sbr | the SBaseRef_t structure to query. |
1
(true) if the "idRef" attribute of the given SBaseRef_t structure is set, 0
(false) otherwise. int SBaseRef_isSetMetaIdRef | ( | SBaseRef_t * | sbr | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given SBaseRef_t structure's metaIdRef is set.
sbr | the SBaseRef_t structure to query. |
1
(true) if the "metaIdRef" attribute of the given SBaseRef_t structure is set, 0
(false) otherwise. int SBaseRef_isSetPortRef | ( | SBaseRef_t * | sbr | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given SBaseRef_t structure's portRef is set.
sbr | the SBaseRef_t structure to query. |
1
(true) if the "portRef" attribute of the given SBaseRef_t structure is set, 0
(false) otherwise. int SBaseRef_isSetSBaseRef | ( | SBaseRef_t * | sbr | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given SBaseRef_t structure's child SBaseRef_t is set.
sbr | the SBaseRef_t structure to query. |
1
(true) if the SBaseRef_t child of the given SBaseRef_t structure is set, 0
(false) otherwise. int SBaseRef_isSetUnitRef | ( | SBaseRef_t * | sbr | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given SBaseRef_t structure's unitRef is set.
sbr | the SBaseRef_t structure to query. |
1
(true) if the "unitRef" attribute of the given SBaseRef_t structure is set, 0
(false) otherwise. int SBaseRef_setIdRef | ( | SBaseRef_t * | sbr, |
const char * | idRef | ||
) |
Sets the idRef of the given SBaseRef_t to a copy of idRef
.
sbr | the SBaseRef_t structure to set. |
idRef | the idRef to assign to the given SBaseRef_t's "idRef" attribute. |
int SBaseRef_setMetaIdRef | ( | SBaseRef_t * | sbr, |
const char * | metaIdRef | ||
) |
Sets the metaIdRef of the given SBaseRef_t to a copy of metaIdRef
.
sbr | the SBaseRef_t structure to set. |
metaIdRef | the metaIdRef to assign to the given SBaseRef_t's "metaIdRef" attribute. |
int SBaseRef_setPortRef | ( | SBaseRef_t * | sbr, |
const char * | portRef | ||
) |
Sets the portRef of the given SBaseRef_t to a copy of portRef
.
sbr | the SBaseRef_t structure to set. |
portRef | the portRef to assign to the given SBaseRef_t's "portRef" attribute. |
int SBaseRef_setSBaseRef | ( | SBaseRef_t * | parent, |
SBaseRef_t * | child | ||
) |
Sets the child SBaseRef_t of the parent
SBaseRef_t to a copy of child
.
parent | the parent SBaseRef_t structure. |
child | the intended child SBaseRef_t structure to copy. |
int SBaseRef_setUnitRef | ( | SBaseRef_t * | sbr, |
const char * | unitRef | ||
) |
Sets the unitRef of the given SBaseRef_t to a copy of unitRef
.
sbr | the SBaseRef_t structure to set. |
unitRef | the unitRef to assign to the given SBaseRef_t's "unitRef" attribute. |
int SBaseRef_unsetIdRef | ( | SBaseRef_t * | sbr | ) |
Unsets the "idRef" attribute of the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to unset. |
int SBaseRef_unsetMetaIdRef | ( | SBaseRef_t * | sbr | ) |
Unsets the "metaIdRef" attribute of the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to unset. |
int SBaseRef_unsetPortRef | ( | SBaseRef_t * | sbr | ) |
Unsets the "portRef" attribute of the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to unset. |
int SBaseRef_unsetSBaseRef | ( | SBaseRef_t * | sbr | ) |
Removes the SBaseRef_t child of the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to unset. |
int SBaseRef_unsetUnitRef | ( | SBaseRef_t * | sbr | ) |
Unsets the "unitRef" attribute of the given SBaseRef_t structure.
sbr | the SBaseRef_t structure to unset. |