libSBML C API  5.18.0
FbcOr_t Class Reference

Detailed Description

fbc An “or” relationship for gene products

FbcOr_t class is used in Version 2 of the SBML Level 3 Flux Balance Constraints (“fbc”) package to represent an "or" relationship between two or more child FbcAssociation_t objects. In other words, it indicates that only one of the child objects are included. Note that since the FbcAssociation_t class is the parent class of GeneProductRef_t, FbcAnd_t, and FbcOr_t, a given FbcOr_t can potentially include nested "and"/"or" combinations of gene products.

Note
This class of objects was introduced in Version 2 of the SBML Level 3 Flux Balance Constraints (“fbc”) specification. In Version 1 of “fbc”, the information encoded by this class can be stored instead using the Association_t and GeneAssociation_t annotation classes. Please see the Version 1 and Version 2 “fbc” specifications for more details.
See also
FbcAssociation_t
FbcAnd_t
GeneProductRef_t

Public Member Functions

int FbcOr_addAssociation (FbcOr_t *fo, const FbcAssociation_t *a)
 Adds a copy of the given FbcAssociation_t to this FbcOr_t. More...
 
FbcOr_tFbcOr_clone (const FbcOr_t *fo)
 Creates and returns a deep copy of this FbcOr_t object. More...
 
FbcOr_tFbcOr_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new FbcOr_t using the given SBML Level, Version and “fbc” package version. More...
 
FbcAnd_tFbcOr_createAnd (FbcOr_t *fo)
 Creates a new FbcAnd_t object, adds it to this FbcOr_t object and returns the FbcAnd_t object created. More...
 
GeneProductRef_tFbcOr_createGeneProductRef (FbcOr_t *fo)
 Creates a new GeneProductRef_t object, adds it to this FbcOr_t object and returns the GeneProductRef_t object created. More...
 
FbcOr_tFbcOr_createOr (FbcOr_t *fo)
 Creates a new FbcOr_t object, adds it to this FbcOr_t object and returns the FbcOr_t object created. More...
 
void FbcOr_free (FbcOr_t *fo)
 Frees this FbcOr_t object. More...
 
FbcAssociation_tFbcOr_getAssociation (FbcOr_t *fo, unsigned int n)
 Get an FbcAssociation_t from the FbcOr_t. More...
 
FbcAssociation_tFbcOr_getAssociationById (FbcOr_t *fo, const char *sid)
 Get an FbcAssociation_t from the FbcOr_t. More...
 
ListOf_tFbcOr_getListOfFbcAssociations (FbcOr_t *fo)
 Returns a ListOf_t * containing FbcAssociation_t objects from this FbcOr_t. More...
 
unsigned int FbcOr_getNumAssociations (FbcOr_t *fo)
 Get the number of FbcAssociation_t objects in this FbcOr_t. More...
 
int FbcOr_hasRequiredAttributes (const FbcOr_t *fo)
 Predicate returning 1 (true) if all the required attributes for this FbcOr_t object have been set. More...
 
int FbcOr_hasRequiredElements (const FbcOr_t *fo)
 Predicate returning 1 (true) if all the required elements for this FbcOr_t object have been set. More...
 
FbcAssociation_tFbcOr_removeAssociation (FbcOr_t *fo, unsigned int n)
 Removes the nth FbcAssociation_t from this FbcOr_t and returns a pointer to it. More...
 
FbcAssociation_tFbcOr_removeAssociationById (FbcOr_t *fo, const char *sid)
 Removes the FbcAssociation_t with the given identifier from this FbcOr_t and returns a pointer to it. More...
 

Member Function Documentation

int FbcOr_addAssociation ( FbcOr_t fo,
const FbcAssociation_t a 
)

Adds a copy of the given FbcAssociation_t to this FbcOr_t.

Parameters
fothe FbcOr_t structure to which the FbcAssociation_t should be added.
athe FbcAssociation_t object to add.
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:
FbcOr_t * FbcOr_clone ( const FbcOr_t fo)

Creates and returns a deep copy of this FbcOr_t object.

Parameters
fothe FbcOr_t structure.
Returns
a (deep) copy of this FbcOr_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.
FbcOr_t * FbcOr_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

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

Parameters
levelan unsigned int, the SBML Level to assign to this FbcOr_t.
versionan unsigned int, the SBML Version to assign to this FbcOr_t.
pkgVersionan unsigned int, the SBML Fbc Version to assign to this FbcOr_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.
FbcAnd_t * FbcOr_createAnd ( FbcOr_t fo)

Creates a new FbcAnd_t object, adds it to this FbcOr_t object and returns the FbcAnd_t object created.

Parameters
fothe FbcOr_t structure to which the FbcAnd_t should be added.
Returns
a new FbcAnd_t object instance.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
GeneProductRef_t * FbcOr_createGeneProductRef ( FbcOr_t fo)

Creates a new GeneProductRef_t object, adds it to this FbcOr_t object and returns the GeneProductRef_t object created.

Parameters
fothe FbcOr_t structure to which the GeneProductRef_t should be added.
Returns
a new GeneProductRef_t object instance.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
FbcOr_t * FbcOr_createOr ( FbcOr_t fo)

Creates a new FbcOr_t object, adds it to this FbcOr_t object and returns the FbcOr_t object created.

Parameters
fothe FbcOr_t structure to which the FbcOr_t should be added.
Returns
a new FbcOr_t object instance.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
void FbcOr_free ( FbcOr_t fo)

Frees this FbcOr_t object.

Parameters
fothe FbcOr_t structure.
FbcAssociation_t * FbcOr_getAssociation ( FbcOr_t fo,
unsigned int  n 
)

Get an FbcAssociation_t from the FbcOr_t.

Parameters
fothe FbcOr_t structure to search.
nan unsigned int representing the index of the FbcAssociation_t to retrieve.
Returns
the nth FbcAssociation_t in the ListOfAssociations within this FbcOr_t. If the index n is invalid, NULL is returned.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
FbcAssociation_t * FbcOr_getAssociationById ( FbcOr_t fo,
const char *  sid 
)

Get an FbcAssociation_t from the FbcOr_t.

Parameters
fothe FbcOr_t structure to search.
sidthe identifier of the FbcAssociation_t to retrieve.
Returns
the FbcAssociation_t in the ListOfAssociations within this FbcOr_t with the given identifier.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
ListOf_t * FbcOr_getListOfFbcAssociations ( FbcOr_t fo)

Returns a ListOf_t * containing FbcAssociation_t objects from this FbcOr_t.

Parameters
fothe FbcOr_t structure whose ListOfAssociations is sought.
Returns
the ListOfAssociations from this FbcOr_t as a ListOf_t *.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
See also
FbcOr_addAssociation()
FbcOr_getAssociationById()
FbcOr_getAssociation()
FbcOr_getNumAssociations()
FbcOr_removeAssociationById()
FbcOr_removeAssociation()
unsigned int FbcOr_getNumAssociations ( FbcOr_t fo)

Get the number of FbcAssociation_t objects in this FbcOr_t.

Parameters
fothe FbcOr_t structure to query.
Returns
the number of FbcAssociation_t objects in this FbcOr_t.
int FbcOr_hasRequiredAttributes ( const FbcOr_t fo)

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

Parameters
fothe FbcOr_t structure.
Returns
1 (true) to indicate that all the required attributes of this FbcOr_t have been set, otherwise 0 (false) is returned.
int FbcOr_hasRequiredElements ( const FbcOr_t fo)

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

Parameters
fothe FbcOr_t structure.
Returns
1 (true) to indicate that all the required elements of this FbcOr_t have been set, otherwise 0 (false) is returned.
Note
The required elements for the FbcOr_t object are:
FbcAssociation_t * FbcOr_removeAssociation ( FbcOr_t fo,
unsigned int  n 
)

Removes the nth FbcAssociation_t from this FbcOr_t and returns a pointer to it.

Parameters
fothe FbcOr_t structure to search.
nan unsigned int representing the index of the FbcAssociation_t to remove.
Returns
a pointer to the nth FbcAssociation_t in this FbcOr_t.
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.
FbcAssociation_t * FbcOr_removeAssociationById ( FbcOr_t fo,
const char *  sid 
)

Removes the FbcAssociation_t with the given identifier from this FbcOr_t and returns a pointer to it.

Parameters
fothe FbcOr_t structure to search.
sidthe identifier of the FbcAssociation_t to remove.
Returns
a pointer to the removed FbcAssociation_t in this FbcOr_t, or NULL if no FbcAssociation_t was found.
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.