COPASI API  4.16.103
CNormalCall.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/compareExpressions/CNormalCall.h,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:26:19 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 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 #ifndef COPASI_CNormalCall
20 #define COPASI_CNormalCall
21 
22 #include <string>
23 #include <vector>
24 
26 #include "copasi/copasi.h"
27 
28 class CNormalFraction;
29 
30 /**
31  * The class for function calls used in CNormal
32  */
33 class CNormalCall : public CNormalBase
34 {
35 public:
36  enum Type
37  {
42  };
43 
44 private:
45  /**
46  * The name of the called function
47  */
48  std::string mName;
49 
50  /**
51  * the call type
52  */
54 
55  /**
56  * Enumeration of members
57  * The members of a call have to be kept in the correct order since the
58  * order of arguments to a call matters.
59  */
60  std::vector<CNormalFraction*> mFractions;
61 
62 public:
63 
64  /**
65  * Default constructor
66  */
67  CNormalCall();
68 
69  /**
70  * Copy Constructor
71  */
72  CNormalCall(const CNormalCall& src);
73 
74  /**
75  * Assignment operator
76  */
77  CNormalCall & operator=(const CNormalCall& src);
78 
79  /**
80  * Smaller operator
81  */
82  bool operator<(const CNormalCall& rhs) const;
83 
84  /**
85  * Destructor
86  */
87  virtual ~CNormalCall();
88 
89  virtual CNormalBase * copy() const;
90 
91  /**
92  * Retrieve the number of summands of this sum.
93  * @return int
94  */
95  int getSize() const;
96 
97  /**
98  * Add fraction to this sum.
99  * @return true.
100  */
101  bool add(const CNormalFraction& fraction);
102 
103  /**
104  * Retrieve the set of fractions of this sum.
105  * @return mFractions.
106  */
107  const std::vector<CNormalFraction*>& getFractions() const;
108 
109  /**
110  * Examine equality of two sums.
111  * @return bool.
112  */
113  bool operator==(const CNormalCall & rhs) const;
114 
115  /**
116  * Sets the fractions of this product.
117  */
118  void setFractions(const std::vector<CNormalFraction*>& set);
119 
120  virtual std::string toString() const;
121 
122  virtual bool simplify();
123 
124  const std::string& getName() const;
125 
126  void setName(const std::string& name);
127 
128  Type getType() const;
129 
130  void setType(Type type);
131 
132  friend std::ostream & operator<< (std::ostream &os, const CNormalCall & d);
133 };
134 
135 #endif // COPASI_CNormalCall
std::string mName
Definition: CNormalCall.h:48
virtual std::string toString() const
bool operator<(const CNormalCall &rhs) const
Definition: CNormalCall.cpp:56
virtual bool simplify()
void setType(Type type)
const std::string & getName() const
CNormalCall & operator=(const CNormalCall &src)
Definition: CNormalCall.cpp:41
const std::vector< CNormalFraction * > & getFractions() const
void setName(const std::string &name)
std::vector< CNormalFraction * > mFractions
Definition: CNormalCall.h:60
virtual ~CNormalCall()
int getSize() const
bool add(const CNormalFraction &fraction)
Type getType() const
void setFractions(const std::vector< CNormalFraction * > &set)
bool operator==(const CNormalCall &rhs) const
friend std::ostream & operator<<(std::ostream &os, const CNormalCall &d)
virtual CNormalBase * copy() const