libSBML C API  5.18.0
FbcAnd_t Class Reference

Detailed Description

fbc An “and” relationship for gene products

FbcAnd_t class is used in Version 2 of the SBML Level 3 Flux Balance Constraints (“fbc”) package to represent an "and" relationship between two or more child FbcAssociation_t objects. In other words, it indicates that all 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 FbcAnd_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
FbcOr_t
GeneProductRef_t

Public Member Functions

int FbcAnd_addAssociation (FbcAnd_t *fa, const FbcAssociation_t *a)
 Adds a copy of the given FbcAssociation_t to this FbcAnd_t. More...
 
FbcAnd_tFbcAnd_clone (const FbcAnd_t *fa)
 Creates and returns a deep copy of this FbcAnd_t object. More...
 
FbcAnd_tFbcAnd_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new FbcAnd_t using the given SBML Level, Version and “fbc” package version. More...
 
FbcAnd_tFbcAnd_createAnd (FbcAnd_t *fa)
 Creates a new FbcAnd_t object, adds it to this FbcAnd_t object and returns the FbcAnd_t object created. More...
 
GeneProductRef_tFbcAnd_createGeneProductRef (FbcAnd_t *fa)
 Creates a new GeneProductRef_t object, adds it to this FbcAnd_t object and returns the GeneProductRef_t object created. More...
 
FbcOr_tFbcAnd_createOr (FbcAnd_t *fa)
 Creates a new FbcOr_t object, adds it to this FbcAnd_t object and returns the FbcOr_t object created. More...
 
void FbcAnd_free (FbcAnd_t *fa)
 Frees this FbcAnd_t object. More...
 
FbcAssociation_tFbcAnd_getAssociation (FbcAnd_t *fa, unsigned int n)
 Get an FbcAssociation_t from the FbcAnd_t. More...
 
FbcAssociation_tFbcAnd_getAssociationById (FbcAnd_t *fa, const char *sid)
 Get an FbcAssociation_t from the FbcAnd_t. More...
 
ListOf_tFbcAnd_getListOfFbcAssociations (FbcAnd_t *fa)
 Returns a ListOf_t * containing FbcAssociation_t objects from this FbcAnd_t. More...
 
unsigned int FbcAnd_getNumAssociations (FbcAnd_t *fa)
 Get the number of FbcAssociation_t objects in this FbcAnd_t. More...
 
int FbcAnd_hasRequiredAttributes (const FbcAnd_t *fa)
 Predicate returning 1 (true) if all the required attributes for this FbcAnd_t object have been set. More...
 
int FbcAnd_hasRequiredElements (const FbcAnd_t *fa)
 Predicate returning 1 (true) if all the required elements for this FbcAnd_t object have been set. More...
 
FbcAssociation_tFbcAnd_removeAssociation (FbcAnd_t *fa, unsigned int n)
 Removes the nth FbcAssociation_t from this FbcAnd_t and returns a pointer to it. More...
 

Member Function Documentation

int FbcAnd_addAssociation ( FbcAnd_t fa,
const FbcAssociation_t a 
)

Adds a copy of the given FbcAssociation_t to this FbcAnd_t.

Parameters
fathe FbcAnd_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:
FbcAnd_t * FbcAnd_clone ( const FbcAnd_t fa)

Creates and returns a deep copy of this FbcAnd_t object.

Parameters
fathe FbcAnd_t structure.
Returns
a (deep) copy of this FbcAnd_t object. pointer if a failure occurred.
FbcAnd_t * FbcAnd_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

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

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

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

Parameters
fathe FbcAnd_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 * FbcAnd_createGeneProductRef ( FbcAnd_t fa)

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

Parameters
fathe FbcAnd_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 * FbcAnd_createOr ( FbcAnd_t fa)

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

Parameters
fathe FbcAnd_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 FbcAnd_free ( FbcAnd_t fa)

Frees this FbcAnd_t object.

Parameters
fathe FbcAnd_t structure.
FbcAssociation_t * FbcAnd_getAssociation ( FbcAnd_t fa,
unsigned int  n 
)

Get an FbcAssociation_t from the FbcAnd_t.

Parameters
fathe FbcAnd_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 FbcAnd_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 * FbcAnd_getAssociationById ( FbcAnd_t fa,
const char *  sid 
)

Get an FbcAssociation_t from the FbcAnd_t.

Parameters
fathe FbcAnd_t structure to search.
sidthe identifier of the FbcAssociation_t to retrieve.
Returns
the FbcAssociation_t with the given sid in the ListOfAssociations within this FbcAnd_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.
ListOf_t * FbcAnd_getListOfFbcAssociations ( FbcAnd_t fa)

Returns a ListOf_t * containing FbcAssociation_t objects from this FbcAnd_t.

Parameters
fathe FbcAnd_t structure whose ListOfAssociations is sought.
Returns
the ListOfAssociations from this FbcAnd_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
FbcAnd_addAssociation()
FbcAnd_getAssociationById()
FbcAnd_getAssociation()
FbcAnd_getNumAssociations()
FbcAnd_removeAssociationById()
FbcAnd_removeAssociation()
unsigned int FbcAnd_getNumAssociations ( FbcAnd_t fa)

Get the number of FbcAssociation_t objects in this FbcAnd_t.

Parameters
fathe FbcAnd_t structure to query.
Returns
the number of FbcAssociation_t objects in this FbcAnd_t.
int FbcAnd_hasRequiredAttributes ( const FbcAnd_t fa)

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

Parameters
fathe FbcAnd_t structure.
Returns
1 (true) to indicate that all the required attributes of this FbcAnd_t have been set, otherwise 0 (false) is returned.
int FbcAnd_hasRequiredElements ( const FbcAnd_t fa)

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

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

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

Parameters
fathe FbcAnd_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 FbcAnd_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.