COPASI API  4.16.103
CCopasiRootContainer.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/report/CCopasiRootContainer.h,v $
3 // $Revision: 1.8 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:32:38 $
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_CCopasiRootContainer
20 #define COPASI_CCopasiRootContainer
21 
26 
27 class CMIRIAMResource;
28 class CFunctionDB;
29 class CConfigurationFile;
30 
31 /**
32  * This is the new root container class.
33  * It will hold some attributes that are used by all datamodels,
34  * e.g.the global function database and the configuration,
35  * and it will hold a list of datamodels.
36  * Currently all methods to create new instances of CCopasiRootContainer
37  * are declared private. This ensures that there can be only one root container
38  * which is initialized by the init method.
39  * If this is necessary or not needs to be discussed.
40  */
42 {
43 private:
44  /**
45  * The default constructor should be private so that nobody can create
46  * new instances of the root container.
47  * The only way to create a root container is through the static init
48  * method.
49  * Maybe this restriction is not necessary. We have to discuss this
50  * later.
51  */
52  CCopasiRootContainer(const bool & withGUI = false);
53 
54  /**
55  * The copy constructor is private as well to make sure that there is only
56  * one root container that can be initialized through the init call.
57  * @param const CCopasiRootContainer & src
58  */
60 
61  /**
62  * The assignment operator is private as well to make sure that there is only
63  * one root container that can be initialized through the init call.
64  * @param const CCopasiRootContainer & src
65  * @return CCopasiRootContainer &
66  */
68 
69  /**
70  * This method needs to be called after a new root container is
71  * constructed.
72  * Since many of the children of the root container need to access the key
73  * factory through the global Root instance, the global root instance need to be created before the children can be initialized.
74  * Calling this Method initializes the children. This method must be
75  * protected since it can only be called once by the global init method.
76  */
77  void initializeChildren();
78 
79 protected:
85  // flag to store if we are running a GUI or not
86  bool mWithGUI;
87 
89 
90 public:
91  // Destructor
92  virtual ~CCopasiRootContainer();
93 
94  /**
95  * This method creates the only root container.
96  */
97  static void init(int argc, char *argv[], const bool & withGui = false);
98 
99  static void destroy();
100 
101  /**
102  * Retrieve the root container
103  */
104  static const CCopasiContainer * getRoot();
105 
106  /**
107  * Returns the a pointer to the configuration.
108  */
110 
111  /**
112  * Returns a pointer to the global function database.
113  */
114  static CFunctionDB * getFunctionList();
115 
116  /**
117  * Returns a pointer to the list of data models.
118  */
120 
121  /**
122  * Creates a new datamodel instance and adds it to the list.
123  * The new instance is returned by the method.
124  */
125  static CCopasiDataModel * addDatamodel();
126 
127  /**
128  * Retrieve the pointer for the function used for importing
129  * kinetics without a kinetic law
130  * @return CFunction * pUnsupportedDelay
131  */
132  static CFunction * getUndefinedFunction();
133 
134  /**
135  * Returns a pointer to the KeyFactory.
136  */
137  static CKeyFactory* getKeyFactory();
138 
139  static const CMIRIAMResource & getUnknownMiriamResource();
140 
141  static bool removeDatamodel(const CCopasiDataModel * pDatamodel);
142 
143  static bool removeDatamodel(const unsigned C_INT32 index);
144 
145  static const char * getLicenseTxt();
146 
147  static const char * getLicenseHTML();
148 };
149 
150 #endif /* COPASI_CCopasiRootContainer */
static const char * getLicenseHTML()
CCopasiRootContainer(const bool &withGUI=false)
static CFunction * getUndefinedFunction()
CMIRIAMResource * mpUnknownResource
static bool removeDatamodel(const CCopasiDataModel *pDatamodel)
CCopasiVector< CCopasiDataModel > * mpDataModelList
#define C_INT32
Definition: copasi.h:90
CConfigurationFile * mpConfiguration
static CConfigurationFile * getConfiguration()
static const char * getLicenseTxt()
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
static CFunctionDB * getFunctionList()
Header file of class CCopasiContainer.
static CCopasiDataModel * addDatamodel()
static const CMIRIAMResource & getUnknownMiriamResource()
static CKeyFactory * getKeyFactory()
The class for handling a chemical kinetic function.
Definition: CFunction.h:29
static void init(int argc, char *argv[], const bool &withGui=false)
static const CCopasiContainer * getRoot()
CCopasiRootContainer & operator=(const CCopasiRootContainer &src)