libSBML C API
5.18.0
|
The Port_t class was introduced by the SBML Level 3 Hierarchical Model_t Composition (“comp”) package to allow a Model_t to define a standard interface between it and other models that might use it as a submodel. It derives from the SBaseRef_t class, and the elements defined there refer to elements in the same parent Model_t as the Port_t object. A Port_t object instance therefore uses those attributes to define a port for a component in a model. When other SBaseRef_t or SBaseRef_t-derived classes refer to a Port_t object using a "portRef" attribute, the element being referenced is the element the Port_t object itself points to.
In the present formulation of the Hierarchical Model Composition package, the use of ports is not enforced, nor is there any mechanism to restrict which ports may be used in what ways—they are only an advisory construct. Future versions of this SBML package may provide additional functionality to support explicit restrictions on port use. For the present definition of Hierarchical Model Composition, users of models containing ports are encouraged to respect the modeler's intention in defining ports, and use the port definitions to interact with components through their ports (when they have ports defined) rather than interact directly with the components.
The required attribute "id" is used to give an identifier to a Port_t object so that other objects can refer to it. The attribute has type PortSId and is essentially identical to the SBML primitive type SId, except that its namespace is limited to the identifiers of Port_t objects defined within a Model_t object. In parallel, the PortSId type has a companion type, PortSIdRef, that corresponds to the SBML primitive type SIdRef; the value space of PortSIdRef is limited to PortSId values.
Public Member Functions | |
Port_t * | Port_clone (Port_t *p) |
Returns a copy of the given Port_t structure. More... | |
Port_t * | Port_create (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new Port_t structure using the given SBML level and version , and the pkgVersion package version. More... | |
void | Port_free (Port_t *p) |
Frees the given Port_t structure. More... | |
char * | Port_getId (Port_t *p) |
Takes an Port_t structure and returns its identifier. More... | |
char * | Port_getName (Port_t *p) |
Takes a Port_t structure and returns its name. More... | |
int | Port_hasRequiredAttributes (Port_t *p) |
Predicate returning true or false depending on whether all the required attributes for the given Port_t structure have been set. More... | |
int | Port_isSetId (Port_t *p) |
Predicate returning 1 (true) or 0 (false) depending on whether the given Port_t structure's identifier is set. More... | |
int | Port_isSetName (Port_t *p) |
Predicate returning 1 (true) or 0 (false) depending on whether the given Port_t structure's name is set. More... | |
int | Port_setId (Port_t *p, const char *sid) |
Assigns the identifier of an Port_t structure. More... | |
int | Port_setName (Port_t *p, const char *name) |
Sets the name of the given Port_t to a copy of name . More... | |
int | Port_unsetId (Port_t *p) |
Unsets the "id" attribute of the given Port_t structure. More... | |
int | Port_unsetName (Port_t *p) |
Unsets the "name" attribute of the given Port_t structure. More... | |
Port_t * Port_create | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new Port_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 Port_t. |
version | an unsigned int, the SBML Version to assign to this Port_t. |
pkgVersion | an unsigned int, the SBML 'comp' package Version to assign to this Port_t. |
void Port_free | ( | Port_t * | p | ) |
char * Port_getId | ( | Port_t * | p | ) |
char * Port_getName | ( | Port_t * | p | ) |
int Port_hasRequiredAttributes | ( | Port_t * | p | ) |
int Port_isSetId | ( | Port_t * | p | ) |
int Port_isSetName | ( | Port_t * | p | ) |
int Port_setId | ( | Port_t * | p, |
const char * | sid | ||
) |
Assigns the identifier of an Port_t structure.
This makes a copy of the string passed in the parameter sid
.
p | the Port_t structure to set. |
sid | the string to use as the identifier. |
sid
of NULL is equivalent to unsetting the "id" attribute. int Port_setName | ( | Port_t * | p, |
const char * | name | ||
) |
Sets the name of the given Port_t to a copy of name
.
p | the Port_t structure to set. |
name | the name to assign to the given Port_t's "name" attribute. |
int Port_unsetId | ( | Port_t * | p | ) |
Unsets the "id" attribute of the given Port_t structure.
p | the Port_t structure to unset. |
int Port_unsetName | ( | Port_t * | p | ) |
Unsets the "name" attribute of the given Port_t structure.
p | the Port_t structure to unset. |