COPASI API  4.16.103
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CEvaluationNodeVector Class Reference

#include <CEvaluationNodeVector.h>

Inheritance diagram for CEvaluationNodeVector:
Inheritance graph
[legend]
Collaboration diagram for CEvaluationNodeVector:
Collaboration graph
[legend]

Public Types

enum  SubType { INVALID = 0x00FFFFFF, VECTOR = 0x00000000 }
 
- Public Types inherited from CEvaluationNode
enum  Type {
  INVALID = 0xFF000000, NUMBER = 0x01000000, CONSTANT = 0x02000000, OPERATOR = 0x03000000,
  OBJECT = 0x04000000, FUNCTION = 0x05000000, CALL = 0x06000000, STRUCTURE = 0x07000000,
  CHOICE = 0x08000000, VARIABLE = 0x09000000, WHITESPACE = 0x0a000000, LOGICAL = 0x0b000000,
  MV_FUNCTION = 0x0c000000, VECTOR = 0x0d000000, DELAY = 0x0e000000
}
 
- Public Types inherited from CCopasiNode< std::string >
typedef std::string Data
 

Public Member Functions

bool addChild (CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
 
 CEvaluationNodeVector ()
 
 CEvaluationNodeVector (const SubType &subType, const Data &data)
 
 CEvaluationNodeVector (const CEvaluationNodeVector &src)
 
virtual std::string getBerkeleyMadonnaString (const std::vector< std::string > &children) const
 
virtual std::string getCCodeString (const std::vector< std::string > &children) const
 
virtual std::string getDisplayString (const std::vector< std::string > &children) const
 
virtual std::string getInfix (const std::vector< std::string > &children) const
 
const std::vector
< CEvaluationNode * > & 
getVector () const
 
virtual std::string getXPPString (const std::vector< std::string > &children) const
 
virtual ASTNode * toAST (const CCopasiDataModel *pDataModel) const
 
virtual ~CEvaluationNodeVector ()
 
- Public Member Functions inherited from CEvaluationNode
void addChildren (const std::vector< CEvaluationNode * > &children)
 
std::string buildBerkeleyMadonnaString () const
 
std::string buildCCodeString () const
 
std::string buildDisplayString () const
 
std::string buildInfix () const
 
std::string buildMMLString (bool expand, const std::vector< std::vector< std::string > > &variables) const
 
std::string buildXPPString () const
 
virtual void calculate ()
 
 CEvaluationNode ()
 
 CEvaluationNode (const CEvaluationNode &src)
 
virtual bool compile (const CEvaluationTree *pTree)
 
CEvaluationNodecopyBranch () const
 
CEvaluationNodecopyNode (CEvaluationNode *child1, CEvaluationNode *child2) const
 
CEvaluationNodecopyNode (const std::vector< CEvaluationNode * > &children) const
 
const CEvaluationNodefindTopMinus (const std::vector< CFunctionAnalyzer::CValue > &callParameters) const
 
virtual std::string getMMLString (const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
 
const TypegetType () const
 
const C_FLOAT64getValue () const
 
const C_FLOAT64getValuePointer () const
 
virtual bool isBoolean () const
 
virtual bool operator!= (const CEvaluationNode &right) const
 
bool operator< (const CEvaluationNode &right) const
 
bool operator< (const CEvaluationNode &rhs)
 
bool operator== (const CEvaluationNode &right) const
 
void printRecursively (std::ostream &os, int indent=0) const
 
void printRecursively () const
 
virtual CEvaluationNodesimplifyNode (const std::vector< CEvaluationNode * > &children) const
 
CEvaluationNodesplitBranch (const CEvaluationNode *splitnode, bool left) const
 
virtual ~CEvaluationNode ()
 
- Public Member Functions inherited from CCopasiNode< std::string >
bool addSibling (CCopasiNode< Data > *pSibling, CCopasiNode< Data > *pAfter=NULL)
 
 CCopasiNode (CCopasiNode< Data > *pParent=NULL)
 
 CCopasiNode (const CCopasiNode< Data > &src)
 
 CCopasiNode (const Data &data, CCopasiNode< Data > *pParent=NULL)
 
bool deleteChildren ()
 
CCopasiNode< Data > * getChild ()
 
const CCopasiNode< Data > * getChild () const
 
CCopasiNode< Data > * getChild (const size_t &index)
 
const CCopasiNode< Data > * getChild (const size_t &index) const
 
virtual const DatagetData () const
 
CCopasiNode< Data > * getNext ()
 
const CCopasiNode< Data > * getNext () const
 
CCopasiNode< Data > * getNextNonChild ()
 
const CCopasiNode< Data > * getNextNonChild () const
 
size_t getNumChildren () const
 
CCopasiNode< Data > * getParent ()
 
const CCopasiNode< Data > * getParent () const
 
CCopasiNode< Data > * getSibling ()
 
const CCopasiNode< Data > * getSibling () const
 
virtual bool removeChild (CCopasiNode< Data > *pChild)
 
virtual bool setData (const Data &data)
 
virtual ~CCopasiNode ()
 

Static Public Member Functions

static CEvaluationNodefromAST (const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
 
- Static Public Member Functions inherited from CEvaluationNode
static CEvaluationNodecreate (const Type &type, const Data &data)
 
static bool isKeyword (const std::string &str)
 
static Type subType (const Type &type)
 
static Type type (const Type &type)
 

Private Attributes

std::vector< CEvaluationNode * > mVector
 

Additional Inherited Members

- Protected Member Functions inherited from CEvaluationNode
 CEvaluationNode (const Type &type, const Data &data)
 
- Protected Member Functions inherited from CCopasiNode< std::string >
bool setChild (CCopasiNode< Data > *pChild)
 
bool setParent (CCopasiNode< Data > *pParent)
 
bool setSibling (CCopasiNode< Data > *pSibling)
 
- Protected Attributes inherited from CEvaluationNode
class CEvaluationNode::CPrecedence mPrecedence
 
const C_FLOAT64mpValue
 
Type mType
 
C_FLOAT64 mValue
 
- Protected Attributes inherited from CCopasiNode< std::string >
Data mData
 

Detailed Description

This is the class for nodes presenting opertors used in an evaluation trees.

Definition at line 33 of file CEvaluationNodeVector.h.

Member Enumeration Documentation

Enumeration of possible node types.

Enumerator
INVALID 
VECTOR 

Definition at line 39 of file CEvaluationNodeVector.h.

Constructor & Destructor Documentation

CEvaluationNodeVector::CEvaluationNodeVector ( )

Default constructor

Definition at line 30 of file CEvaluationNodeVector.cpp.

References CEvaluationNode::mPrecedence, and PRECEDENCE_FUNCTION.

30  :
32  mVector()
#define PRECEDENCE_FUNCTION
class CEvaluationNode::CPrecedence mPrecedence
std::vector< CEvaluationNode * > mVector
CEvaluationNodeVector::CEvaluationNodeVector ( const SubType subType,
const Data data 
)

Default constructor

Parameters
constSubType & subType
constData & data

Definition at line 35 of file CEvaluationNodeVector.cpp.

References fatalError, CEvaluationNode::mPrecedence, PRECEDENCE_FUNCTION, and VECTOR.

36  :
38  mVector()
39 {
40  switch (subType)
41  {
42  case VECTOR:
43  break;
44 
45  default:
46  fatalError();
47  break;
48  }
49 
51 }
#define fatalError()
#define PRECEDENCE_FUNCTION
static Type subType(const Type &type)
class CEvaluationNode::CPrecedence mPrecedence
std::vector< CEvaluationNode * > mVector
CEvaluationNodeVector::CEvaluationNodeVector ( const CEvaluationNodeVector src)

Copy constructor

Parameters
constCEvaluationNodeVector & src

Definition at line 53 of file CEvaluationNodeVector.cpp.

53  :
54  CEvaluationNode(src),
55  mVector(src.mVector)
56 {}
std::vector< CEvaluationNode * > mVector
CEvaluationNodeVector::~CEvaluationNodeVector ( )
virtual

Destructor

Definition at line 58 of file CEvaluationNodeVector.cpp.

58 {}

Member Function Documentation

bool CEvaluationNodeVector::addChild ( CCopasiNode< Data > *  pChild,
CCopasiNode< Data > *  pAfter = NULL 
)
virtual

Add a child to a node. If pAfter == this the child will be inserted at the fornt of the list of children.

Parameters
CCopasiNode<Data > * pChild
CCopasiNode<Data > * pAfter (default: NULL appended to the list of children)
Returns
bool Success

Reimplemented from CCopasiNode< std::string >.

Definition at line 123 of file CEvaluationNodeVector.cpp.

References CCopasiNode< _Data >::addChild(), and mVector.

Referenced by CEvaluationNodeNormalizer::normalizeCEvaluationNodeVector().

125 {
126  CCopasiNode< Data >::addChild(pChild, pAfter);
127  mVector.push_back(static_cast<CEvaluationNode *>(pChild));
128 
129  return true;
130 }
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
Definition: CCopasiNode.h:156
std::vector< CEvaluationNode * > mVector
CEvaluationNode * CEvaluationNodeVector::fromAST ( const ASTNode *  pASTNode,
const std::vector< CEvaluationNode * > &  children 
)
static

Creates a new CEvaluationNodeCall from an ASTNode and the given children

Parameters
constASTNode* pNode
conststd::vector< CEvaluationNode * > & children
Returns
CEvaluationNode * pCretedNode

Definition at line 111 of file CEvaluationNodeVector.cpp.

112 {
113  return NULL;
114 }
std::string CEvaluationNodeVector::getBerkeleyMadonnaString ( const std::vector< std::string > &  children) const
virtual

Retrieve the display string of the node and its eventual child nodes in Berkeley Madonna format.

Returns
const Data & value

Reimplemented from CEvaluationNode.

Definition at line 99 of file CEvaluationNodeVector.cpp.

100 {
101  return "@";
102 }
std::string CEvaluationNodeVector::getCCodeString ( const std::vector< std::string > &  children) const
virtual

Retrieve the display string of the node and its eventual child nodes in C.

Returns
const Data & value

Reimplemented from CEvaluationNode.

Definition at line 93 of file CEvaluationNodeVector.cpp.

94 {
95  return "@";
96 }
std::string CEvaluationNodeVector::getDisplayString ( const std::vector< std::string > &  children) const
virtual

Retrieve the display string of the node and its eventual child nodes.

Returns
const Data & value

Reimplemented from CEvaluationNode.

Definition at line 77 of file CEvaluationNodeVector.cpp.

78 {
79  std::string DisplayString = "{";
80 
81  std::vector< std::string >::const_iterator it = children.begin();
82  std::vector< std::string >::const_iterator end = children.end();
83 
84  if (it != end) DisplayString += *it++;
85 
86  for (; it != end; ++it)
87  DisplayString += "," + *it;
88 
89  return DisplayString + "}";
90 }
std::string CEvaluationNodeVector::getInfix ( const std::vector< std::string > &  children) const
virtual

Retrieve the infix value of the node and its eventual child nodes.

Returns
const Data & value

Reimplemented from CEvaluationNode.

Definition at line 61 of file CEvaluationNodeVector.cpp.

62 {
63  std::string Infix = "{";
64 
65  std::vector< std::string >::const_iterator it = children.begin();
66  std::vector< std::string >::const_iterator end = children.end();
67 
68  if (it != end) Infix += *it++;
69 
70  for (; it != end; ++it)
71  Infix += "," + *it;
72 
73  return Infix + "}";
74 }
const std::vector< CEvaluationNode * > & CEvaluationNodeVector::getVector ( ) const

Retrieve the vector of evaluation nodes

Returns
const std::vector< CEvaluationNode * > & vector

Definition at line 132 of file CEvaluationNodeVector.cpp.

References mVector.

Referenced by CEvaluationNodeNormalizer::normalizeCEvaluationNodeVector().

133 {return mVector;}
std::vector< CEvaluationNode * > mVector
std::string CEvaluationNodeVector::getXPPString ( const std::vector< std::string > &  children) const
virtual

Retrieve the display string of the node and its eventual child nodes in XPPAUT format.

Returns
const Data & value

Reimplemented from CEvaluationNode.

Definition at line 105 of file CEvaluationNodeVector.cpp.

106 {
107  return "@";
108 }
ASTNode * CEvaluationNodeVector::toAST ( const CCopasiDataModel pDataModel) const
virtual

Create a new ASTNode corresponding to this choice node.

Returns
ASTNode* return a pointer to the newly created node;

Reimplemented from CEvaluationNode.

Definition at line 116 of file CEvaluationNodeVector.cpp.

117 {
118  // :TODO:
119  ASTNode* node = new ASTNode(AST_FUNCTION_PIECEWISE);
120  return node;
121 }

Member Data Documentation

std::vector< CEvaluationNode * > CEvaluationNodeVector::mVector
private

Definition at line 139 of file CEvaluationNodeVector.h.

Referenced by addChild(), and getVector().


The documentation for this class was generated from the following files: