Constraint.cpp File Reference

Detailed Description

Implementations of Constraint and ListOfConstraints.

Author:
Ben Bornstein
Include dependency graph for Constraint.cpp:

Functions

Constraint_t * Constraint_clone (const Constraint_t *c)
 Creates and returns a deep copy of the given Constraint_t structure.
Constraint_t * Constraint_create (unsigned int level, unsigned int version)
 Creates a new Constraint_t structure using the given SBML level and version values.
Constraint_t * Constraint_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new Constraint_t structure using the given SBMLNamespaces_t structure.
void Constraint_free (Constraint_t *c)
 Frees the given Constraint_t structure.
const ASTNode_t * Constraint_getMath (const Constraint_t *c)
 Get the mathematical expression of this Constraint.
const XMLNode_t * Constraint_getMessage (const Constraint_t *c)
 Get the message, if any, associated with this Constraint.
char * Constraint_getMessageString (const Constraint_t *c)
 Get the message string, if any, associated with this Constraint.
const XMLNamespaces_t * Constraint_getNamespaces (Constraint_t *c)
 Returns a list of XMLNamespaces_t associated with this Constraint_t structure.
int Constraint_isSetMath (const Constraint_t *c)
 Predicate returning true or false depending on whether a mathematical formula is defined for this Constraint.
int Constraint_isSetMessage (const Constraint_t *c)
 Predicate returning true or false depending on whether a message is defined for this Constraint.
int Constraint_setMath (Constraint_t *c, const ASTNode_t *math)
 Sets the mathematical expression of this Constraint.
int Constraint_setMessage (Constraint_t *c, const XMLNode_t *xhtml)
 Sets the message of this Constraint.
int Constraint_unsetMessage (Constraint_t *c)
 Unsets the "message" subelement of this Constraint.

Function Documentation

Constraint_t* Constraint_clone ( const Constraint_t *  c)

Creates and returns a deep copy of the given Constraint_t structure.

Parameters:
cthe Constraint_t structure to copy
Returns:
a (deep) copy of Constraint_t.
Constraint_t* Constraint_create ( unsigned int  level,
unsigned int  version 
)

Creates a new Constraint_t structure using the given SBML level and version values.

Parameters:
levelan unsigned int, the SBML Level to assign to this Constraint
versionan unsigned int, the SBML Version to assign to this Constraint
Returns:
a pointer to the newly created Constraint_t structure.
Note:
Once a Constraint has been added to an SBMLDocument, the level and version for the document override those used to create the Constraint. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
Constraint_t* Constraint_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new Constraint_t structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this Constraint
Returns:
a pointer to the newly created Constraint_t structure.
Note:
Once a Constraint has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the Constraint. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
void Constraint_free ( Constraint_t *  c)

Frees the given Constraint_t structure.

const ASTNode_t* Constraint_getMath ( const Constraint_t *  c)

Get the mathematical expression of this Constraint.

Parameters:
cthe Constraint_t structure
Returns:
the math for this Constraint, as an ASTNode.
const XMLNode_t* Constraint_getMessage ( const Constraint_t *  c)

Get the message, if any, associated with this Constraint.

Parameters:
cthe Constraint_t structure
Returns:
the message for this Constraint, as an XMLNode.
char* Constraint_getMessageString ( const Constraint_t *  c)

Get the message string, if any, associated with this Constraint.

Parameters:
cthe Constraint_t structure
Returns:
the message for this Constraint, as a string (char*). NULL is returned if the message is not set.

returned char* should be freed with safe_free() by the caller.

const XMLNamespaces_t* Constraint_getNamespaces ( Constraint_t *  c)

Returns a list of XMLNamespaces_t associated with this Constraint_t structure.

Parameters:
cthe Constraint_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
int Constraint_isSetMath ( const Constraint_t *  c)

Predicate returning true or false depending on whether a mathematical formula is defined for this Constraint.

Parameters:
cthe Constraint_t structure
Returns:
a nonzero integer if the "math" subelement for this Constraint is set, zero (0) otherwise.
int Constraint_isSetMessage ( const Constraint_t *  c)

Predicate returning true or false depending on whether a message is defined for this Constraint.

Parameters:
cthe Constraint_t structure
Returns:
a nonzero integer if the "message" subelement for this Constraint is set, zero (0) otherwise.
int Constraint_setMath ( Constraint_t *  c,
const ASTNode_t *  math 
)

Sets the mathematical expression of this Constraint.

Parameters:
cthe Constraint_t structure
mathan ASTNode expression to be assigned as the "math" subelement of this Constraint
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
int Constraint_setMessage ( Constraint_t *  c,
const XMLNode_t *  xhtml 
)

Sets the message of this Constraint.

Parameters:
cthe Constraint_t structure
xhtmlan XML tree containing XHTML content.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
int Constraint_unsetMessage ( Constraint_t *  c)

Unsets the "message" subelement of this Constraint.

Parameters:
cthe Constraint_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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines