COPASI API  4.16.103
CEvaluationNodeConstant.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/function/CEvaluationNodeConstant.h,v $
3  $Revision: 1.28 $
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_CEvaluationNodeConstant
24 #define COPASI_CEvaluationNodeConstant
25 
26 class ASTNode;
27 class CCopasiDataModel;
28 
29 /**
30  * This is class for nodes presenting Constants used in an evaluation trees
31  */
33 {
34 public:
35  /**
36  * Enumeration of possible node types.
37  */
38  enum SubType
39  {
40  INVALID = 0x00FFFFFF,
41  PI = 0x00000000,
42  EXPONENTIALE = 0x00000001,
43 
44 #ifdef TRUE
45 # undef TRUE
46 #endif
47  TRUE = 0x00000002,
48 
49 #ifdef FALSE
50 # undef FALSE
51 #endif
52  FALSE = 0x00000003,
53 
54  _INFINITY = 0x00000004,
55  _NaN = 0x00000005
56  };
57 
58  // Operations
59 private:
60  /**
61  * Default constructor
62  */
64 
65 public:
66  /**
67  * Default constructor
68  * @param const SubType & subType
69  * @param const Data & data
70  */
72  const Data & data);
73 
74  /**
75  * Copy constructor
76  * @param const CEvaluationNodeConstant & src
77  */
79 
80  /**
81  * Destructor
82  */
83  virtual ~CEvaluationNodeConstant();
84 
85  /**
86  * Retrieve the display string of the node and its eventual child nodes.
87  * in C format.
88  * @return const Data & value
89  * */
90  virtual std::string getCCodeString(const std::vector< std::string > & children) const;
91 
92  /**
93  * Retrieve the display string of the node and its eventual child nodes.
94  * in Berkeley Madonna format.
95  * @return const Data & value
96  * */
97  virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > & children) const;
98 
99  /**
100  ** Retrieve the display string of the node and its eventual child nodes.
101  ** in XPPAUT format.
102  ** @return const Data & value
103  **/
104  virtual std::string getXPPString(const std::vector< std::string > & children) const;
105 
106  /**
107  * Creates a new CEvaluationNodeCall from an ASTNode and the given children
108  * @param const ASTNode* pNode
109  * @param const std::vector< CEvaluationNode * > & children
110  * @return CEvaluationNode * pCretedNode
111  */
112  static CEvaluationNode * fromAST(const ASTNode * pASTNode, const std::vector< CEvaluationNode * > & children);
113 
114  /**
115  * Check whether the result is Boolean
116  * @return bool isBoolean
117  */
118  virtual bool isBoolean() const;
119 
120  /**
121  * Create a new ASTNode corresponding to this ConstantNode.
122  * @return ASTNode* return a pointer to the newly created node;
123  */
124  virtual ASTNode* toAST(const CCopasiDataModel* pDataModel) const;
125 
126  /**
127  * Build the MathML string
128  * @param const std::vector< std::string > & children
129  * @param bool expand = true
130  * @param const std::vector< std::vector< std::string > > & variables
131  * @return std::string MMLString
132  */
133  virtual std::string getMMLString(const std::vector< std::string > & children,
134  bool expand,
135  const std::vector< std::vector< std::string > > & variables) const;
136 
137 };
138 
139 #endif // COPASI_CEvaluationNodeConstant
virtual std::string getCCodeString(const std::vector< std::string > &children) const
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
static CEvaluationNode * fromAST(const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
virtual std::string getXPPString(const std::vector< std::string > &children) const
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
static Type subType(const Type &type)
virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > &children) const