COPASI API  4.16.103
CEvaluationNodeChoice.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/function/CEvaluationNodeChoice.h,v $
3  $Revision: 1.21 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2012/05/16 23:11:31 $
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_CEvaluationNodeChoice
24 #define COPASI_CEvaluationNodeChoice
25 
26 #include <limits>
27 
28 class CCopasiDataModel;
29 
30 /**
31  * This is the class for nodes presenting operators 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  IF = 0x00000000
43  };
44 
45  // Operations
46 private:
47  /**
48  * Default constructor
49  */
51 
52 public:
53  /**
54  * Default constructor
55  * @param const SubType & subType
56  * @param const Data & data
57  */
59  const Data & data);
60 
61  /**
62  * Copy constructor
63  * @param const CEvaluationNodeChoice & src
64  */
66 
67  /**
68  * Destructor
69  */
70  virtual ~CEvaluationNodeChoice();
71 
72  /**
73  * Calculate the numerical result of the node. It is assumed that
74  * all child nodes are up to date.
75  */
76  virtual void calculate();
77 
78  /**
79  * Compile a node;
80  * @param const CEvaluationTree * pTree
81  * @return bool success;
82  */
83  virtual bool compile(const CEvaluationTree * pTree);
84 
85  /**
86  * Retrieve the infix value of the node and its eventual child nodes.
87  * @return const Data & value
88  */
89  virtual std::string getInfix(const std::vector< std::string > & children) const;
90 
91  /**
92  * Retrieve the display string of the node and its eventual child nodes.
93  * @return const Data & value
94  */
95  virtual std::string getDisplayString(const std::vector< std::string > & children) const;
96 
97  /**
98  * Retrieve the display string of the node and its eventual child nodes in C .
99  * @return const Data & value
100  */
101  virtual std::string getCCodeString(const std::vector< std::string > & children) const;
102 
103  /**
104  * Retrieve the display string of the node and its eventual child nodes
105  * in Berkeley Madonna format.
106  * @return const Data & value
107  */
108  virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > & children) const;
109 
110  /**
111  * Retrieve the display string of the node and its eventual child nodes
112  * in XPPAUT format.
113  * @return const Data & value
114  */
115  virtual std::string getXPPString(const std::vector< std::string > & children) const;
116 
117  /**
118  * Creates a new CEvaluationNodeCall from an ASTNode and the given children
119  * @param const ASTNode* pNode
120  * @param const std::vector< CEvaluationNode * > & children
121  * @return CEvaluationNode * pCretedNode
122  */
123  static CEvaluationNode * fromAST(const ASTNode * pASTNode, const std::vector< CEvaluationNode * > & children);
124 
125  /**
126  * Create a new ASTNode corresponding to this choice node.
127  * @return ASTNode* return a pointer to the newly created node;
128  */
129  virtual ASTNode* toAST(const CCopasiDataModel* pDataModel) const;
130 
131  /**
132  * Build the MathML string
133  * @param const std::vector< std::string > & children
134  * @param bool expand = true
135  * @param const std::vector< std::vector< std::string > > & variables
136  * @return std::string MMLString
137  */
138  virtual std::string getMMLString(const std::vector< std::string > & children,
139  bool expand,
140  const std::vector< std::vector< std::string > > & variables) const;
141 
142 private:
143 
144  // Attributes
145 private:
149 };
150 
151 #endif // COPASI_CEvaluationNodeChoice
virtual bool compile(const CEvaluationTree *pTree)
virtual std::string getInfix(const std::vector< std::string > &children) const
static CEvaluationNode * fromAST(const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
virtual std::string getXPPString(const std::vector< std::string > &children) const
virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > &children) const
virtual std::string getDisplayString(const std::vector< std::string > &children) const
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
static Type subType(const Type &type)
virtual std::string getCCodeString(const std::vector< std::string > &children) const