{comp}
comp
Base class for references to objects.
The SBaseRef class was introduced by the SBML Level 3 Hierarchical Model Composition package (“comp”) as the principle way by which submodel elements may be referenced. The SBaseRef class is usually found as the base class of a Port, Deletion, ReplacedElement, or ReplacedBy class, but may appear as an child of one of the above classes if the parent object references a Submodel.
An SBaseRef object must reference an element using exactly one of the optional attributes of the class. Subclasses of SBaseRef may define additional optional attributes that are legal ways to reference an element.
SBaseRef objects may reference elements that do not live in the Model parent of the SBaseRef object. However, the SBaseRef class itself does not provide a method of determining which Model or Submodel is being referenced. The subclasses of SBaseRef provide methods for this instead.
Once the Model to which the SBaseRef object is referencing has been established, there are four optional attributes defined in the SBaseRef class that are each methods of referencing an element:
- "portRef" (type 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 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.
- "idRef" (type 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 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.
- "unitRef" (type UnitSIdRef): This attribute is used to refer to the identifier of a UnitDefinition 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.)
- "metaIdRef" (type 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 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, all SBML objects have the potential to have a meta identifier value.
An SBaseRef object may have up to one subcomponent named "sBaseRef", of type SBaseRef. 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 object of such a chain (which will necessarily be an object of class Port, Deletion, ReplacedElement or ReplacedBy, because they are the only classes derived from the class SBaseRef) must refer to a Submodel object in the containing model. All child SBaseRef objects in the chain must refer to components inside the Model instance to which the Submodel refers.
|
virtual void | clearReferencedElement () |
| Removes the saved referenced element, if it had been saved earlier. More...
|
|
virtual SBaseRef * | clone () const |
| Creates and returns a deep copy of this SBaseRef object. More...
|
|
SBaseRef * | createSBaseRef () |
| Creates a new, empty SBaseRef, adds it to this SBaseRef and returns the created SBaseRef. More...
|
|
virtual List * | getAllElements (ElementFilter *filter=NULL) |
| Returns a List of all child SBase* objects, including those nested to an arbitrary depth. More...
|
|
virtual SBase * | getElementByMetaId (const std::string &metaid) |
| Returns the first child element it can find with the given metaid , or itself if it has the given metaid , or NULL if no such object is found. More...
|
|
virtual SBase * | getElementBySId (const std::string &id) |
| Returns the first child element found that has the given id in the model-wide SId namespace, or NULL if no such object is found. More...
|
|
virtual const std::string & | getElementName () const |
| Returns the XML element name of this SBML object. More...
|
|
virtual const std::string & | getIdRef () const |
| Returns the value of the "idRef" attribute of this SBaseRef. More...
|
|
virtual const std::string & | getMetaIdRef () const |
| Returns the value of the "metaIdRef" attribute of this SBaseRef. More...
|
|
virtual int | getNumReferents () const |
| Returns how many elements are being referred to by this SBaseRef. More...
|
|
virtual const std::string & | getPortRef () const |
| Returns the value of the "portRef" attribute of this SBaseRef. More...
|
|
virtual SBase * | getReferencedElement () |
| Returns the object pointed to by this element. More...
|
|
virtual SBase * | getReferencedElementFrom (Model *model) |
| Examines the referenced Model for the referenced object, and returns it, if found. More...
|
|
const SBaseRef * | getSBaseRef () const |
| Get the child sBaseRef of this sBaseRef. More...
|
|
SBaseRef * | getSBaseRef () |
| Get the child sBaseRef of this SBaseRef. More...
|
|
virtual int | getTypeCode () const |
| Returns the libSBML type code of this object instance. More...
|
|
virtual const std::string & | getUnitRef () const |
| Returns the value of the "unitRef" attribute of this SBaseRef. More...
|
|
virtual bool | hasRequiredAttributes () const |
| Returns true if getNumReferents() is exactly 1. More...
|
|
virtual bool | isSetIdRef () const |
| Predicate returning true or false depending on whether this SBaseRef's "idRef" attribute has been set. More...
|
|
virtual bool | isSetMetaIdRef () const |
| Predicate returning true or false depending on whether this SBaseRef's "metaIdRef" attribute has been set. More...
|
|
virtual bool | isSetPortRef () const |
| Predicate returning true or false depending on whether this SBaseRef's "portRef" attribute has been set. More...
|
|
bool | isSetSBaseRef () const |
| Predicate for testing whether the sBaseRef for this SBaseRef is set. More...
|
|
virtual bool | isSetUnitRef () const |
| Predicate returning true or false depending on whether this SBaseRef's "unitRef" attribute has been set. More...
|
|
SBaseRef & | operator= (const SBaseRef &source) |
| Assignment operator. More...
|
|
virtual int | performDeletion () |
| DEPRECATED FUNCTION: DO NOT USE. More...
|
|
virtual int | removeFromParentAndDelete () |
| Finds this SBaseRef's parent, which can either be a List or can be another SBaseRef, and tells it to remove this. More...
|
|
virtual void | renameSIdRefs (const std::string &oldid, const std::string &newid) |
|
virtual int | saveReferencedElement () |
| Finds and stores the referenced object by finding the Model it needs to point to, calling 'saveReferencedElement' on its parent (which will also be a SBaseRef or one of its subclasses), and the storing the result. More...
|
|
| SBaseRef (unsigned int level=CompExtension::getDefaultLevel(), unsigned int version=CompExtension::getDefaultVersion(), unsigned int pkgVersion=CompExtension::getDefaultPackageVersion()) |
| Creates a new SBaseRef with the given level, version, and package version. More...
|
|
| SBaseRef (CompPkgNamespaces *compns) |
| Creates a new SBaseRef with the given CompPkgNamespaces object. More...
|
|
| SBaseRef (const SBaseRef &source) |
| Copy constructor. More...
|
|
virtual int | setIdRef (const std::string &id) |
| Sets the value of the "idRef" attribute of this SBaseRef. More...
|
|
virtual int | setMetaIdRef (const std::string &id) |
| Sets the value of the "metaIdRef" attribute of this SBaseRef. More...
|
|
virtual int | setPortRef (const std::string &id) |
| Sets the value of the "portRef" attribute of this SBaseRef. More...
|
|
int | setSBaseRef (const SBaseRef *sBaseRef) |
| Sets the sBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance. More...
|
|
virtual int | setUnitRef (const std::string &id) |
| Sets the value of the "unitRef" attribute of this SBaseRef. More...
|
|
virtual int | unsetIdRef () |
| Unsets the value of the "idRef" attribute of this SBaseRef. More...
|
|
virtual int | unsetMetaIdRef () |
| Unsets the value of the "metaIdRef" attribute of this SBaseRef. More...
|
|
virtual int | unsetPortRef () |
| Unsets the value of the "portRef" attribute of this SBaseRef. More...
|
|
virtual int | unsetSBaseRef () |
| Unsets the child SBaseRef of this SBaseRef. More...
|
|
virtual int | unsetUnitRef () |
| Unsets the value of the "unitRef" attribute of this SBaseRef. More...
|
|
virtual | ~SBaseRef () |
| Destructor. More...
|
|