libSBML C API
5.18.0
|
The CompModelPlugin_t class inherits from the SBMLSBasePlugin class, and codifies the extensions to the Model_t class defined in the SBML Level 3 Hierarchical Model_t Composition (“comp”) package. This extension allows a Model_t to define Submodels (other Models that are instantiated as new parts of the parent Model_t), and Ports, a defined interface for including the given Model_t as a Submodel_t of a different Model_t.
Submodels are stored in an optional child ListOfSubmodels_t object, which, if present, must contain one or more Submodel_t objects. All of the Submodels present in the ListOfSubmodels_t are defined to be instantiated in the 'complete' Model_t.
Ports are stored in an optional child ListOfPorts_t object, which, if present, must contain one or more Port_t objects. All of the Ports present in the ListOfPorts_t collectively define the 'port interface' of the Model_t.
int CompModelPlugin_addPort | ( | CompModelPlugin_t * | cmp, |
const Port_t * | p | ||
) |
Adds a copy of the given Port_t to this CompModelPlugin_t.
cmp | the CompModelPlugin_t structure to which the Port_t should be added. |
p | the Port_t object to add. |
int CompModelPlugin_addSubmodel | ( | CompModelPlugin_t * | cmp, |
const Submodel_t * | s | ||
) |
Adds a copy of the given Submodel_t to this CompModelPlugin_t.
cmp | the CompModelPlugin_t structure to which the Submodel_t should be added. |
s | the Submodel_t object to add. |
Port_t * CompModelPlugin_createPort | ( | CompModelPlugin_t * | cmp | ) |
Creates a new Port_t object, adds it to this CompModelPlugin_t object and returns the Port_t object created.
cmp | the CompModelPlugin_t structure to which the Port_t should be added. |
Submodel_t * CompModelPlugin_createSubmodel | ( | CompModelPlugin_t * | cmp | ) |
Creates a new Submodel_t, adds it to this CompModelPlugin_t and returns the Submodel_t created.
cmp | the CompModelPlugin_t structure to which the Submodel_t should be added. |
ListOf_t * CompModelPlugin_getListOfPorts | ( | CompModelPlugin_t * | cmp | ) |
Returns a ListOf_t * containing Port_t objects from this CompModelPlugin_t.
cmp | the CompModelPlugin_t structure whose ListOfPorts_t is sought. |
ListOf_t * CompModelPlugin_getListOfSubmodels | ( | CompModelPlugin_t * | cmp | ) |
Returns a ListOf_t * containing Submodel_t objects from this CompModelPlugin_t.
cmp | the CompModelPlugin_t structure whose ListOfSubmodels_t is sought. |
unsigned int CompModelPlugin_getNumPorts | ( | CompModelPlugin_t * | cmp | ) |
Get the number of Port_t objects in this CompModelPlugin_t.
cmp | the CompModelPlugin_t structure to query. |
unsigned int CompModelPlugin_getNumSubmodels | ( | CompModelPlugin_t * | cmp | ) |
Get the number of Submodel_t objects in this CompModelPlugin_t.
cmp | the CompModelPlugin_t structure to query. |
Port_t * CompModelPlugin_getPort | ( | CompModelPlugin_t * | cmp, |
unsigned int | n | ||
) |
Get a Port_t from the CompModelPlugin_t.
cmp | the CompModelPlugin_t structure to search. |
n | an unsigned int representing the index of the Port_t to retrieve. |
NULL
if no such object exists.Port_t * CompModelPlugin_getPortById | ( | CompModelPlugin_t * | cmp, |
const char * | sid | ||
) |
Get a Port_t from the CompModelPlugin_t based on its identifier.
cmp | the CompModelPlugin_t structure to search. |
sid | a string representing the identifier of the Port_t to retrieve. |
sid
or NULL
if no such Port_t exists.Submodel_t * CompModelPlugin_getSubmodel | ( | CompModelPlugin_t * | cmp, |
unsigned int | n | ||
) |
Get a Submodel_t from the CompModelPlugin_t.
cmp | the CompModelPlugin_t structure to search. |
n | an unsigned int representing the index of the Submodel_t to retrieve. |
NULL
if no such object exists.Submodel_t * CompModelPlugin_getSubmodelById | ( | CompModelPlugin_t * | cmp, |
const char * | sid | ||
) |
Get a Submodel_t from the CompModelPlugin_t based on its identifier.
cmp | the CompModelPlugin_t structure to search. |
sid | a string representing the identifier of the Submodel_t to retrieve. |
sid
or NULL
if no such Submodel_t exists.Port_t * CompModelPlugin_removePort | ( | CompModelPlugin_t * | cmp, |
unsigned int | n | ||
) |
Removes the nth Port_t from this CompModelPlugin_t and returns a pointer to it.
cmp | the CompModelPlugin_t structure to search. |
n | an unsigned int representing the index of the Port_t to remove. |
Submodel_t * CompModelPlugin_removeSubmodel | ( | CompModelPlugin_t * | cmp, |
unsigned int | n | ||
) |
Removes the nth Submodel_t from this CompModelPlugin_t and returns a pointer to it.
cmp | the CompModelPlugin_t structure to search. |
n | an unsigned int representing the index of the Submodel_t to remove. |