copasi API  0.1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
CEvaluationTree Class Reference

#include <CEvaluationTree.h>

Inheritance diagram for CEvaluationTree:
CCopasiContainer CAnnotation CCopasiObject CExpression CFunction CKinFunction CMassAction

List of all members.

Public Types

enum  Type {
  Function = 0, MassAction, PreDefined, UserDefined,
  Expression
}

Public Member Functions

 CEvaluationTree (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const Type &type=Function)
 CEvaluationTree (const CEvaluationTree &src, const CCopasiContainer *pParent=NULL)
virtual ~CEvaluationTree ()
const CEvaluationTree::TypegetType () const
const std::string & getKey () const
bool setRoot (CEvaluationNode *pRootNode)
bool setTree (const ASTNode &pRootNode)
virtual ASTNode * toAST (const CCopasiDataModel *pDataModel) const
virtual bool setInfix (const std::string &infix)
virtual bool compile ()
bool isUsable () const
bool isBoolean () const
const std::string & getInfix () const
std::string::size_type getErrorPosition () const
const std::vector
< CEvaluationNode * > & 
getNodeList () const
virtual unsigned C_INT32 getVariableIndex (const std::string &name) const
virtual const C_FLOAT64 & getVariableValue (const unsigned C_INT32 &index) const
CEvaluationNodegetRoot ()
const CEvaluationNodegetRoot () const
bool updateTree ()
void setSBMLId (const std::string &id)
const std::string & getSBMLId () const
bool hasCircularDependency () const
bool dependsOnTree (const std::string &name) const
std::set< const CCopasiObject * > getDeletedObjects () const
bool calls (std::set< std::string > &list) const

Static Public Member Functions

static CEvaluationTreecreate (CEvaluationTree::Type type)
static CEvaluationTreecopy (const CEvaluationTree &src)
static CEvaluationNodeconvertASTNode (const ASTNode &node)
static bool completeEvaluationTreeList (std::vector< CEvaluationTree * > &list, const unsigned C_INT32 &added=0)

Public Attributes

std::string mSBMLId

Static Public Attributes

static const std::string TypeName []
static const char * XMLType []

Protected Member Functions

void setType (const CEvaluationTree::Type &type)
bool parse ()
bool compileNodes ()

Protected Attributes

CEvaluationTree::Type mType
std::string mInfix
bool mUsable
std::vector< CEvaluationNode * > * mpNodeList
CEvaluationNodempRoot
C_FLOAT64 mValue
bool mBooleanRequired

Member Enumeration Documentation

The valid types of a function

Enumerator:
Function 
MassAction 
PreDefined 
UserDefined 
Expression 

Constructor & Destructor Documentation

CEvaluationTree::CEvaluationTree ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL,
const Type type = Function 
)

Default constructor

Parameters:
conststd::string & name (default: "NoName")
constCCopasiContainer * pParent (default: NULL)
constCEvaluationTree::Type & type (default: Function)
CEvaluationTree::CEvaluationTree ( const CEvaluationTree src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters:
constCEvaluationTree & src
constCCopasiContainer * pParent (default: NULL)
CEvaluationTree::~CEvaluationTree ( ) [virtual]

Destructor


Member Function Documentation

bool CEvaluationTree::calls ( std::set< std::string > &  list) const

Check whether the evaluation tree calls any tree in the list

Parameters:
std::set<std::string > & list
Returns:
bool calls
bool CEvaluationTree::compile ( ) [virtual]

Compile the evaluation tree.

Reimplemented in CMassAction.

bool CEvaluationTree::compileNodes ( ) [protected]

Compile the individual nodes.

Returns:
bool success
bool CEvaluationTree::completeEvaluationTreeList ( std::vector< CEvaluationTree * > &  list,
const unsigned C_INT32 &  added = 0 
) [static]

Complete the list of evaluation tree such that all called trees are includes.

Parameters:
std::vector<CEvaluationTree * > & list
constunsigned C_INT32 & added (Default: list.size())
Returns:
bool success
CEvaluationNode * CEvaluationTree::convertASTNode ( const ASTNode &  node) [static]

Converts an SBML ASTNode to the corresponding CEvaluationNode tree.

Parameters:
constASTNode& node
Returns:
CEvaluationNode*
CEvaluationTree * CEvaluationTree::copy ( const CEvaluationTree src) [static]

Copy an EvaluationTree of the specified type. Note: the returned object has to be released after use with delete.

Parameters:
constEvaluationTree & src
Returns:
EvaluationTree * pEvaluationTree
CEvaluationTree * CEvaluationTree::create ( CEvaluationTree::Type  type) [static]

Create an EvaluationTree of the specified type. Note: the returned object has to be released after use with delete.

Parameters:
CEvaluationTree::Typetype
Returns:
EvaluationTree * pEvaluationTree
bool CEvaluationTree::dependsOnTree ( const std::string &  name) const

Checks whether the tree has a call node referring to the expression with the given name

Parameters:
conststd::string & name
Returns:
bool dependsOn
std::set< const CCopasiObject * > CEvaluationTree::getDeletedObjects ( ) const

Retrieve the list of deleted objects.

Returns:
std::set< const CCopasiObject * > deletedObjects
std::string::size_type CEvaluationTree::getErrorPosition ( ) const

Retrieve the position of the error in the string description. std::string::npos indicates no error.

Returns:
std::string::size_type errorPosition
const std::string & CEvaluationTree::getInfix ( ) const

Retrieve the infix description of the tree

Returns:
const std::string & infix
const std::string & CEvaluationTree::getKey ( ) const [virtual]

Retrieves the key of the EvaluationTree

Returns:
const std::string & key

Reimplemented from CCopasiObject.

const std::vector< CEvaluationNode * > & CEvaluationTree::getNodeList ( ) const

Retrieve the list of nodes

Returns:
const std::vector< CEvaluationNode * > & nodeList;
CEvaluationNode * CEvaluationTree::getRoot ( )

Returns the root node of the tree.

const CEvaluationNode * CEvaluationTree::getRoot ( ) const

Returns the root node of the tree.

const std::string & CEvaluationTree::getSBMLId ( ) const

Returns a reference to the SBML Id.

const CEvaluationTree::Type & CEvaluationTree::getType ( ) const

Retrieves the type of the function

Returns:
const CEvaluationTree::Type & type
unsigned C_INT32 CEvaluationTree::getVariableIndex ( const std::string &  name) const [virtual]

Retrieve the index to the value of the named variable.

Parameters:
conststd::string & name
Returns:
unsigned C_INT32

Reimplemented in CFunction.

const C_FLOAT64 & CEvaluationTree::getVariableValue ( const unsigned C_INT32 &  index) const [virtual]

Retrieve the value of the indexed variable

Parameters:
constunsigned C_INT32 & index
Returns:
const C_FLOAT64 & variableValue

Reimplemented in CFunction.

bool CEvaluationTree::hasCircularDependency ( ) const

Check whether the the tree has circular dependencies.

Returns:
bool hasCircularDependency
bool CEvaluationTree::isBoolean ( ) const

Check whether this function evaluates to a boolean value.

Returns:
bool isBoolean
bool CEvaluationTree::isUsable ( ) const

Check whether this function is usable, i.e., properly defined

Returns:
bool isUsable
bool CEvaluationTree::parse ( ) [protected]

Parse the description

Returns:
bool success
bool CEvaluationTree::setInfix ( const std::string &  infix) [virtual]

Set the infix description of the tree and compile it.

Parameters:
conststd::string & infix
Returns:
bool success

Reimplemented in CMassAction, CExpression, and CFunction.

bool CEvaluationTree::setRoot ( CEvaluationNode pRootNode)

Sets the root node of the tree.

Parameters:
CEvaluationNode*root node of the tree
Returns:
bool success
void CEvaluationTree::setSBMLId ( const std::string &  id)

Sets the SBMLId.

bool CEvaluationTree::setTree ( const ASTNode &  pRootNode)

Sets the complete tree from an SBML ASTNode.

Parameters:
constASTNode& root node of the tree
Returns:
bool success
void CEvaluationTree::setType ( const CEvaluationTree::Type type) [protected]

Set the type of the function

Parameters:
constCEvaluationTree::Type & type
ASTNode * CEvaluationTree::toAST ( const CCopasiDataModel pDataModel) const [virtual]

Converts a CEvaluationTree to an ASTNode based tree.

Returns:
ASTNode* root node of the tree.
bool CEvaluationTree::updateTree ( )

Updates the infix and the nodeList


Member Data Documentation

Indicates whether the tree must evaluate to a boolean value.

std::string CEvaluationTree::mInfix [protected]

The infix representation of the expression

std::vector< CEvaluationNode * >* CEvaluationTree::mpNodeList [protected]

A vector of nodes containing the result of parse.

The root node of the tree.

The id of the corresponding function in an SBML file. This value is either set upon importing an SBML file, or when the object is first exported to an SBML file.

The type of the function

bool CEvaluationTree::mUsable [protected]

Value indicating whether this functions might be used in a model

C_FLOAT64 CEvaluationTree::mValue [protected]

The last computed value of the tree;

const std::string CEvaluationTree::TypeName [static]
Initial value:
  {"userdefined", "predefined", "predefined", "userdefined", "userdefined", "userdefined", ""}

The string representation of valid types of a function

const char * CEvaluationTree::XMLType [static]
Initial value:
  {"Function", "MassAction", "PreDefined", "UserDefined", "Expression", "Boolean", NULL}

The string representation of valid types of a function


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines