COPASI API  4.16.103
CEvaluationNodeVariable.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/function/CEvaluationNodeVariable.h,v $
3 // $Revision: 1.11 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2012/05/16 23:11:32 $
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_CEvaluationNodeVariable
24 #define COPASI_CEvaluationNodeVariable
25 
26 class ASTNode;
27 class CCopasiDataModel;
28 
29 /**
30  * This is class for nodes presenting numbers used in an evaluation trees
31  */
33 {
34 public:
35  /**
36  * Enumeration of possible node types.
37  * The typing of variables must be handled by the tree.
38  */
39  enum SubType
40  {
41  INVALID = 0x00FFFFFF,
42  ANY = 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 CEvaluationNodeVariable & src
64  */
66 
67  /**
68  * Destructor
69  */
70  virtual ~CEvaluationNodeVariable();
71 
72  /**
73  * Compile a node;
74  * @param const CEvaluationTree * pTree
75  * @return bool success;
76  */
77  virtual bool compile(const CEvaluationTree * pTree);
78 
79  /**
80  * Calculate the numerical result of the node. It is assumed that
81  * all child nodes are up to date.
82  */
83  virtual void calculate();
84 
85  /**
86  * Converts this node to an AST Node of type AST_NAME
87  * @return ASTNode* the resulting ASTNode.
88  */
89  virtual ASTNode* toAST(const CCopasiDataModel* pDataModel) const;
90 
91  /**
92  * Build the MathML string
93  * @param const std::vector< std::string > & children
94  * @param bool expand = true
95  * @param const std::vector< std::vector< std::string > > & variables
96  * @return std::string MMLString
97  */
98  virtual std::string getMMLString(const std::vector< std::string > & children,
99  bool expand,
100  const std::vector< std::vector< std::string > > & variables) const;
101 
102  /**
103  * return the index of the variable in the function parameter list
104  */
105  size_t getIndex() const;
106 
107  //Attributes
108 private:
109  /**
110  * Pointer to the evaluation tree.
111  */
113 
114  /**
115  * Index of the variable used to retrieve its value from the tree.
116  */
117  size_t mIndex;
118 };
119 
120 #endif // COPASI_CEvaluationNodeVariable
const CEvaluationTree * mpTree
static Type subType(const Type &type)
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
virtual bool compile(const CEvaluationTree *pTree)