libSBML C API  5.18.0
CompartmentReference_t Class Reference

Detailed Description

multi Child of a Compartment_t that references a different Compartment_t.

A CompartmentReference_t object is a child of an extended Compartment_t (via the MultiCompartmentPlugin_t), and provides a way for that Compartment_t to reference another Compartment_t, and indicates that the referenced Compartment_t is a sub-compartment in a composite parent compartment. Compartments may be arbitrarily nested in this way, but this nesting cannot be circular.

Public Member Functions

CompartmentReference_tCompartmentReference_clone (CompartmentReference_t *cr)
 Creates and returns a deep copy of this CompartmentReference_t object. More...
 
CompartmentReference_tCompartmentReference_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new CompartmentReference_t using the given SBML Level, Version and “multi” package version. More...
 
void CompartmentReference_free (CompartmentReference_t *cr)
 Frees this CompartmentReference_t object. More...
 
char * CompartmentReference_getCompartment (const CompartmentReference_t *cr)
 Returns the value of the "compartment" attribute of this CompartmentReference_t. More...
 
char * CompartmentReference_getId (const CompartmentReference_t *cr)
 Returns the value of the "id" attribute of this CompartmentReference_t. More...
 
char * CompartmentReference_getName (const CompartmentReference_t *cr)
 Returns the value of the "name" attribute of this CompartmentReference_t. More...
 
int CompartmentReference_hasRequiredAttributes (CompartmentReference_t *cr)
 Predicate returning 1 (true) if all the required attributes for this CompartmentReference_t object have been set. More...
 
int CompartmentReference_isSetCompartment (const CompartmentReference_t *cr)
 Predicate returning 1 (true) if this CompartmentReference_t's "compartment" attribute is set. More...
 
int CompartmentReference_isSetId (const CompartmentReference_t *cr)
 Predicate returning 1 (true) if this CompartmentReference_t's "id" attribute is set. More...
 
int CompartmentReference_isSetName (const CompartmentReference_t *cr)
 Predicate returning 1 (true) if this CompartmentReference_t's "name" attribute is set. More...
 
int CompartmentReference_setCompartment (CompartmentReference_t *cr, const char *compartment)
 Sets the value of the "compartment" attribute of this CompartmentReference_t. More...
 
int CompartmentReference_setId (CompartmentReference_t *cr, const char *id)
 Sets the value of the "id" attribute of this CompartmentReference_t. More...
 
int CompartmentReference_setName (CompartmentReference_t *cr, const char *name)
 Sets the value of the "name" attribute of this CompartmentReference_t. More...
 
int CompartmentReference_unsetCompartment (CompartmentReference_t *cr)
 Unsets the value of the "compartment" attribute of this CompartmentReference_t. More...
 
int CompartmentReference_unsetId (CompartmentReference_t *cr)
 Unsets the value of the "id" attribute of this CompartmentReference_t. More...
 
int CompartmentReference_unsetName (CompartmentReference_t *cr)
 Unsets the value of the "name" attribute of this CompartmentReference_t. More...
 

Member Function Documentation

CompartmentReference_t * CompartmentReference_clone ( CompartmentReference_t cr)

Creates and returns a deep copy of this CompartmentReference_t object.

Parameters
crthe CompartmentReference_t structure.
Returns
a (deep) copy of this CompartmentReference_t object.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
CompartmentReference_t * CompartmentReference_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new CompartmentReference_t using the given SBML Level, Version and “multi” package version.

Parameters
levelan unsigned int, the SBML Level to assign to this CompartmentReference_t.
versionan unsigned int, the SBML Version to assign to this CompartmentReference_t.
pkgVersionan unsigned int, the SBML Multi Version to assign to this CompartmentReference_t.
Note
Attempting to add an object to an SBMLDocument_t having a different combination of SBML Level, Version and XML namespaces than the object itself will result in an error at the time a caller attempts to make the addition. A parent object must have compatible Level, Version and XML namespaces. (Strictly speaking, a parent may also have more XML namespaces than a child, but the reverse is not permitted.) The restriction is necessary to ensure that an SBML model has a consistent overall structure. This requires callers to manage their objects carefully, but the benefit is increased flexibility in how models can be created by permitting callers to create objects bottom-up if desired. In situations where objects are not yet attached to parents (e.g., SBMLDocument_t), knowledge of the intented SBML Level and Version help libSBML determine such things as whether it is valid to assign a particular value to an attribute. For packages, this means that the parent object to which this package element is being added must have been created with the package namespace, or that the package namespace was added to it, even if that parent is not a package object itself.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
void CompartmentReference_free ( CompartmentReference_t cr)

Frees this CompartmentReference_t object.

Parameters
crthe CompartmentReference_t structure.
char * CompartmentReference_getCompartment ( const CompartmentReference_t cr)

Returns the value of the "compartment" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure whose compartment is sought.
Returns
the value of the "compartment" attribute of this CompartmentReference_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
char * CompartmentReference_getId ( const CompartmentReference_t cr)

Returns the value of the "id" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure whose id is sought.
Returns
the value of the "id" attribute of this CompartmentReference_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
char * CompartmentReference_getName ( const CompartmentReference_t cr)

Returns the value of the "name" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure whose name is sought.
Returns
the value of the "name" attribute of this CompartmentReference_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
int CompartmentReference_hasRequiredAttributes ( CompartmentReference_t cr)

Predicate returning 1 (true) if all the required attributes for this CompartmentReference_t object have been set.

Parameters
crthe CompartmentReference_t structure.
Returns
1 (true) to indicate that all the required attributes of this CompartmentReference_t have been set, otherwise 0 (false) is returned.
Note
The required attributes for the CompartmentReference_t object are:
  • "compartment"
int CompartmentReference_isSetCompartment ( const CompartmentReference_t cr)

Predicate returning 1 (true) if this CompartmentReference_t's "compartment" attribute is set.

Parameters
crthe CompartmentReference_t structure.
Returns
1 (true) if this CompartmentReference_t's "compartment" attribute has been set, otherwise 0 (false) is returned.
int CompartmentReference_isSetId ( const CompartmentReference_t cr)

Predicate returning 1 (true) if this CompartmentReference_t's "id" attribute is set.

Parameters
crthe CompartmentReference_t structure.
Returns
1 (true) if this CompartmentReference_t's "id" attribute has been set, otherwise 0 (false) is returned.
int CompartmentReference_isSetName ( const CompartmentReference_t cr)

Predicate returning 1 (true) if this CompartmentReference_t's "name" attribute is set.

Parameters
crthe CompartmentReference_t structure.
Returns
1 (true) if this CompartmentReference_t's "name" attribute has been set, otherwise 0 (false) is returned.
int CompartmentReference_setCompartment ( CompartmentReference_t cr,
const char *  compartment 
)

Sets the value of the "compartment" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure.
compartmentconst char * value of the "compartment" attribute to be set.
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 CompartmentReference_setId ( CompartmentReference_t cr,
const char *  id 
)

Sets the value of the "id" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure.
idconst char * value of the "id" attribute to be set.
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: Calling this function with id = NULL or an empty string is equivalent to calling CompartmentReference_unsetId().
int CompartmentReference_setName ( CompartmentReference_t cr,
const char *  name 
)

Sets the value of the "name" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure.
nameconst char * value of the "name" attribute to be set.
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: Calling this function with name = NULL or an empty string is equivalent to calling CompartmentReference_unsetName().
int CompartmentReference_unsetCompartment ( CompartmentReference_t cr)

Unsets the value of the "compartment" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure.
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 CompartmentReference_unsetId ( CompartmentReference_t cr)

Unsets the value of the "id" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure.
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 CompartmentReference_unsetName ( CompartmentReference_t cr)

Unsets the value of the "name" attribute of this CompartmentReference_t.

Parameters
crthe CompartmentReference_t structure.
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: