COPASI API  4.16.103
CEvaluationNodeNumber.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef COPASI_CEvaluationNodeNumber
16 #define COPASI_CEvaluationNodeNumber
17 
18 class CCopasiDataModel;
19 
20 /**
21  * This is class for nodes presenting numbers used in an evaluation trees
22  */
24 {
25 public:
26  /**
27  * Enumeration of possible node types.
28  */
29  enum SubType
30  {
31  INVALID = 0x00FFFFFF,
32  DOUBLE = 0x00000000,
33  INTEGER = 0x00000001,
34  ENOTATION = 0x00000002,
35  RATIONALE = 0x00000003
36  };
37 
38  // Operations
39 private:
40  /**
41  * Default constructor
42  */
44 
45 public:
46  /**
47  * Specific constructor
48  * @param const SubType & subType
49  * @param const Data & data
50  */
52  const Data & data);
53 
54  /**
55  * Specific constructor
56  * @param const C_FLOAT64 & number
57  */
58  CEvaluationNodeNumber(const C_FLOAT64 & number);
59 
60  /**
61  * Copy constructor
62  * @param const CEvaluationNodeNumber & src
63  */
65 
66  /**
67  * Destructor
68  */
69  virtual ~CEvaluationNodeNumber();
70 
71  /**
72  * Creates a new CEvaluationNodeCall from an ASTNode and the given children
73  * @param const ASTNode* pNode
74  * @param const std::vector< CEvaluationNode * > & children
75  * @return CEvaluationNode * pCretedNode
76  */
77  static CEvaluationNode * fromAST(const ASTNode * pASTNode, const std::vector< CEvaluationNode * > & children);
78 
79  /**
80  * Create a new ASTNode corresponding to this NumberNode.
81  * @return ASTNode* return a pointer to the newly created node;
82  */
83  ASTNode* toAST(const CCopasiDataModel* pDataModel) const;
84 
85  /**
86  * Build the MathML string
87  * @param const std::vector< std::string > & children
88  * @param bool expand = true
89  * @param const std::vector< std::vector< std::string > > & variables
90  * @return std::string MMLString
91  */
92  virtual std::string getMMLString(const std::vector< std::string > & children,
93  bool expand,
94  const std::vector< std::vector< std::string > > & variables) const;
95 
96  /**
97  * Retrieve the display string of the node and its eventual child nodes in C.
98  * @return string representing a double value
99  */
100  virtual std::string getCCodeString(const std::vector< std::string > & children) const;
101 };
102 
103 #endif // COPASI_CEvaluationNodeNumber
static CEvaluationNode * fromAST(const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
virtual std::string getCCodeString(const std::vector< std::string > &children) const
static Type subType(const Type &type)
#define C_FLOAT64
Definition: copasi.h:92
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
ASTNode * toAST(const CCopasiDataModel *pDataModel) const