COPASI API  4.16.103
CEvaluationNodeVector.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/function/CEvaluationNodeVector.h,v $
3  $Revision: 1.14 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2012/05/16 17:00:56 $
7  End CVS Header */
8 
9 // Copyright (C) 2012 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 #ifndef COPASI_CEvaluationNodeVector
24 #define COPASI_CEvaluationNodeVector
25 
26 #include <limits>
27 
28 class CCopasiDataModel;
29 
30 /**
31  * This is the class for nodes presenting opertors used in an evaluation trees.
32  */
34 {
35 public:
36  /**
37  * Enumeration of possible node types.
38  */
39  enum SubType
40  {
41  INVALID = 0x00FFFFFF,
42  VECTOR = 0x00000000
43  };
44 
45  // Operations
46 public:
47  /**
48  * Default constructor
49  */
51 
52  /**
53  * Default constructor
54  * @param const SubType & subType
55  * @param const Data & data
56  */
58  const Data & data);
59 
60  /**
61  * Copy constructor
62  * @param const CEvaluationNodeVector & src
63  */
65 
66  /**
67  * Destructor
68  */
69  virtual ~CEvaluationNodeVector();
70 
71  /**
72  * Retrieve the infix value of the node and its eventual child nodes.
73  * @return const Data & value
74  */
75  virtual std::string getInfix(const std::vector< std::string > & children) const;
76 
77  /**
78  * Retrieve the display string of the node and its eventual child nodes.
79  * @return const Data & value
80  */
81  virtual std::string getDisplayString(const std::vector< std::string > & children) const;
82 
83  /**
84  * Retrieve the display string of the node and its eventual child nodes in C.
85  * @return const Data & value
86  */
87  virtual std::string getCCodeString(const std::vector< std::string > & children) const;
88 
89  /**
90  * Retrieve the display string of the node and its eventual child nodes
91  * in Berkeley Madonna format.
92  * @return const Data & value
93  */
94  virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > & children) const;
95 
96  /**
97  * Retrieve the display string of the node and its eventual child nodes
98  * in XPPAUT format.
99  * @return const Data & value
100  */
101  virtual std::string getXPPString(const std::vector< std::string > & children) const;
102 
103  /**
104  * Creates a new CEvaluationNodeCall from an ASTNode and the given children
105  * @param const ASTNode* pNode
106  * @param const std::vector< CEvaluationNode * > & children
107  * @return CEvaluationNode * pCretedNode
108  */
109  static CEvaluationNode * fromAST(const ASTNode * pASTNode, const std::vector< CEvaluationNode * > & children);
110 
111  /**
112  * Create a new ASTNode corresponding to this choice node.
113  * @return ASTNode* return a pointer to the newly created node;
114  */
115  virtual ASTNode* toAST(const CCopasiDataModel* pDataModel) const;
116 
117  /**
118  * Add a child to a node.
119  * If pAfter == this the child will be inserted at the fornt of the list
120  * of children.
121  * @param CCopasiNode< Data > * pChild
122  * @param CCopasiNode< Data > * pAfter
123  * (default: NULL appended to the list of children)
124  * @return bool Success
125  */
126  bool addChild(CCopasiNode< Data > * pChild,
127  CCopasiNode< Data > * pAfter = NULL);
128 
129  /**
130  * Retrieve the vector of evaluation nodes
131  * @return const std::vector< CEvaluationNode * > & vector
132  */
133  const std::vector< CEvaluationNode * > & getVector() const;
134 
135 private:
136 
137  // Attributes
138 private:
139  std::vector< CEvaluationNode * > mVector;
140 };
141 
142 #endif // COPASI_CEvaluationNodeVector
virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > &children) const
virtual std::string getXPPString(const std::vector< std::string > &children) const
const std::vector< CEvaluationNode * > & getVector() const
virtual std::string getInfix(const std::vector< std::string > &children) const
bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
static CEvaluationNode * fromAST(const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
static Type subType(const Type &type)
std::vector< CEvaluationNode * > mVector
virtual std::string getDisplayString(const std::vector< std::string > &children) const
virtual std::string getCCodeString(const std::vector< std::string > &children) const