COPASI API  4.16.103
CEvaluationNodeObject.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/function/CEvaluationNodeObject.h,v $
3  $Revision: 1.29 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2012/05/17 18:11:30 $
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_CEvaluationNodeObject
24 #define COPASI_CEvaluationNodeObject
25 
27 
29 class CCopasiDataModel;
30 
31 /**
32  * This is class for nodes presenting numbers used in an evaluation trees
33  */
35 {
36 public:
37  /**
38  * Enumeration of possible node types.
39  * The typing of variables must be handled by the tree.
40  */
41  enum SubType
42  {
43  INVALID = 0x00FFFFFF,
44  CN = 0x00000000,
45  POINTER = 0x00000001
46  };
47 
48  // Operations
49 private:
50  /**
51  * Default constructor
52  */
54 
55 public:
56  /**
57  * Default constructor
58  * @param const SubType & subType
59  * @param const Data & data
60  */
62  const Data & data);
63 
64  /**
65  * Specific constructor
66  * @param const Data & data
67  */
68  CEvaluationNodeObject(const C_FLOAT64 * pValue);
69 
70  /**
71  * Copy constructor
72  * @param const CEvaluationNodeObject & src
73  */
75 
76  /**
77  * Destructor
78  */
79  virtual ~CEvaluationNodeObject();
80 
81  /**
82  * Compile a node;
83  * @param const CEvaluationTree * pTree
84  * @return bool success;
85  */
86  virtual bool compile(const CEvaluationTree * pTree);
87 
88  /**
89  * Retrieve the value of the node.
90  * @return const Data & value
91  */
92  virtual const Data & getData() const;
93 
94  /**
95  * Set the data of the Node.
96  * @param const Data & data
97  * @return bool success
98  */
99  virtual bool setData(const Data & data);
100 
101  /**
102  * Retrieve the infix value of the node and its eventual child nodes.
103  * @return const Data & value
104  */
105  virtual std::string getInfix(const std::vector< std::string > & children) const;
106 
107  /**
108  * Retrieve the display string of the node and its eventual child nodes.
109  * @return const Data & value
110  */
111  virtual std::string getDisplayString(const std::vector< std::string > & children) const;
112 
113  /**
114  * Retrieve the display string of the node and its eventual child nodes in C.
115  * @return const Data & value
116  */
117  virtual std::string getCCodeString(const std::vector< std::string > & children) const;
118 
119  /**
120  * Retrieve the display string of the node and its eventual child nodes in
121  * Berkeley Madonna format.
122  * @return const Data & value
123  */
124  virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > & children) const;
125 
126  /**
127  * Retrieve the display string of the node and its eventual child nodes in
128  * XPPAUT format.
129  * @return const Data & value
130  */
131  virtual std::string getXPPString(const std::vector< std::string > & children) const;
132 
133  /**
134  * Creates a new CEvaluationNodeCall from an ASTNode and the given children
135  * @param const ASTNode* pNode
136  * @param const std::vector< CEvaluationNode * > & children
137  * @return CEvaluationNode * pCretedNode
138  */
139  static CEvaluationNode * fromAST(const ASTNode * pASTNode, const std::vector< CEvaluationNode * > & children);
140 
141  /**
142  * Converts this node to an ASTNode.
143  * @return ASTNode the resulting ASTNode.
144  */
145  virtual ASTNode* toAST(const CCopasiDataModel* pDataModel) const;
146 
147  /**
148  * Retrieve the CN of the referred object.
149  * @return const CRegisteredObjectName & objectCN
150  */
151  const CRegisteredObjectName & getObjectCN() const;
152 
153  /**
154  * Retrieve the pointer to the referred object interface
155  * @return const CObjectInterface * pObjectInterface
156  */
157  const CObjectInterface * getObjectInterfacePtr() const;
158 
159  /**
160  * Retrieve the pointer to the value of the referred object
161  * @return const C_FLOAT64 * pObjectValue
162  */
163  const C_FLOAT64 * getObjectValuePtr() const;
164 
165  /**
166  * Set the pointer to the value of the referred object
167  * @param C_FLOAT64 * pObjectValue
168  */
169  void setObjectValuePtr(C_FLOAT64 * pObjectValue);
170 
171  /**
172  * Build the MathML string
173  * @param const std::vector< std::string > & children
174  * @param bool expand = true
175  * @param const std::vector< std::vector< std::string > > & variables
176  * @return std::string MMLString
177  */
178  virtual std::string getMMLString(const std::vector< std::string > & children,
179  bool expand,
180  const std::vector< std::vector< std::string > > & variables) const;
181 
182  //Attributes
183 private:
184  /**
185  * Pointer to the object
186  */
188 
189  /**
190  * The registered object name to track eventual renaming.
191  */
193 };
194 
195 #endif // COPASI_CEvaluationNodeObject
static CEvaluationNode * fromAST(const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
virtual std::string getDisplayString(const std::vector< std::string > &children) const
const CObjectInterface * getObjectInterfacePtr() const
const CRegisteredObjectName & getObjectCN() const
void setObjectValuePtr(C_FLOAT64 *pObjectValue)
virtual std::string getInfix(const std::vector< std::string > &children) const
const CObjectInterface * mpObject
CRegisteredObjectName mRegisteredObjectCN
virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > &children) const
virtual std::string getXPPString(const std::vector< std::string > &children) const
static Type subType(const Type &type)
const C_FLOAT64 * getObjectValuePtr() const
#define C_FLOAT64
Definition: copasi.h:92
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
virtual bool setData(const Data &data)
virtual std::string getCCodeString(const std::vector< std::string > &children) const
virtual bool compile(const CEvaluationTree *pTree)
virtual const Data & getData() const