COPASI API  4.16.103
CCompartment.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/model/CCompartment.h,v $
3 // $Revision: 1.51 $
4 // $Name: $
5 // $Author: ssahle $
6 // $Date: 2009/05/04 14:51:12 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  * CCompartment
20  *
21  * Derived from Gepasi's ccompart.cpp
22  * (C) Pedro Mendes 1995-2000
23  *
24  * Converted for COPASI by Pedro Mendes
25  */
26 #ifndef COPASI_CCompartment
27 #define COPASI_CCompartment
28 
29 #include <string>
30 
31 #include "model/CModelValue.h"
33 #include "model/CMetab.h"
34 
35 class CReadConfig;
36 
37 class CCompartment : public CModelEntity
38 {
39 private:
40  /**
41  * Metabolites located in the compartment.
42  * @supplierCardinality 0..*
43  * @associates <{CMetab}>
44  */
46 
47 public:
48  /**
49  * Default constructor.
50  * @param const std::string & name (default: "NoName")
51  * @param const CCopasiContainer * pParent (default: NULL)
52  */
53  CCompartment(const std::string & name = "NoName",
54  const CCopasiContainer * pParent = NULL);
55 
56  /**
57  * Copy constructor.
58  * @param "const CCompartment &" src
59  * @param const CCopasiContainer * pParent (default: NULL)
60  */
61  CCompartment(const CCompartment & src,
62  const CCopasiContainer * pParent = NULL);
63 
64  /**
65  * Destructor.
66  * The destructor does nothing.
67  */
68  virtual ~CCompartment();
69 
70  /**
71  * Retrieve the units of the child object.
72  * @return std::string units
73  */
74  virtual std::string getChildObjectUnits(const CCopasiObject * pObject) const;
75 
76  /**
77  * Cleanup
78  */
79  void cleanup();
80 
81  /**
82  * Retrieve the list of deleted numeric child objects;
83  * @return std::set< const CCopasiObject * > deletedObjects
84  */
85  virtual std::set< const CCopasiObject * > getDeletedObjects() const;
86 
87  /**
88  * Loads an object with data coming from a CReadConfig object.
89  * (CReadConfig object reads an input stream)
90  * @param pconfigbuffer reference to a CReadConfig object.
91  * @return mFail
92  * @see mFail
93  */
94  C_INT32 load(CReadConfig & configbuffer);
95 
96  /**
97  * Retrieve the vector of contained metabolites
98  * @return CCopasiVectorNS < CMetab > & metabolites
99  */
101 
102  /**
103  * Retrieve the vector of contained metabolites
104  * @return const CCopasiVectorNS < CMetab > & metabolites
105  */
107 
108  /**
109  * Adds a metabolite to the compartment. Only the concentration is taken from
110  * the metabolite, the number of particles is calculated according to the
111  * volume of the compartment
112  * @param const CMetab & metabolite;
113  * @return bool success
114  */
115  bool createMetabolite(const CMetab & metabolite);
116 
117  /**
118  * Adds a metabolite to the compartment. Only the concentration is taken from
119  * the metabolite, the number of particles is calculated according to the
120  * volume of the compartment
121  * @param CMetab * metabolite;
122  * @return bool success
123  */
124  bool addMetabolite(CMetab * metabolite);
125 
126  /**
127  * Set the dimensionality of the compartment. May be 0, 1, 2, or 3.
128  * If the value is not valid it will be ignored and the return value will be false
129  */
130  bool setDimensionality(unsigned C_INT32 dim);
131 
132  /**
133  * Get the dimensionality of the compartment
134  */
135  unsigned C_INT32 getDimensionality() const;
136 
137  /**
138  * Friend declaration for ostream operator <<
139  * @param std::ostream & os
140  * @param const CCompartment & d
141  * @return std::ostream & os
142  */
143  friend std::ostream & operator<<(std::ostream &os, const CCompartment & d);
144 
145 private:
146  /**
147  * Initialize the contained CCopasiObjects
148  */
149  void initObjects();
150 
151 protected:
152  /**
153  * The dimensionality of the compartment. Can be 0, 1, 2, or 3
154  */
156 };
157 
158 #endif // COPASI_CCompartment
Header file of class CModelEntity and CModelValue.
bool addMetabolite(CMetab *metabolite)
CCopasiVectorNS< CMetab > & getMetabolites()
void initObjects()
bool setDimensionality(unsigned C_INT32 dim)
C_INT32 load(CReadConfig &configbuffer)
unsigned C_INT32 getDimensionality() const
#define C_INT32
Definition: copasi.h:90
Definition: CMetab.h:178
virtual std::set< const CCopasiObject * > getDeletedObjects() const
virtual std::string getChildObjectUnits(const CCopasiObject *pObject) const
virtual ~CCompartment()
CCompartment(const std::string &name="NoName", const CCopasiContainer *pParent=NULL)
CCopasiVectorNS< CMetab > mMetabolites
Definition: CCompartment.h:45
unsigned C_INT32 mDimensionality
Definition: CCompartment.h:155
friend std::ostream & operator<<(std::ostream &os, const CCompartment &d)
bool createMetabolite(const CMetab &metabolite)