CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
Manager.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/rdbModel/rdbModel/Management/Manager.h,v 1.1.1.1 2005/10/17 06:10:53 maqm Exp $
2#ifndef RDBMODEL_MANAGER_H
3#define RDBMODEL_MANAGER_H
4// #include <map>
5
7#include "rdbModel/Rdb.h"
8
9namespace rdbModel{
10
11 class Builder;
12
13 /**
14 * This class implement the manager for the sections part of the XML file.
15 * It is a singleton.
16 * @author D.Favretto & R.Giannitrapani
17 */
18 class Manager {
19 public:
20 // enum buildType{all,constants,sections,materials,idDictionary};
21
22
23 /** The destructor must be invoched by the client before leaving the
24 application. It will destroy explicitely the Rdb object and this
25 will start the deallocation of all the objects hierarchy */
26 ~Manager();
27
28 /** This method is used to access the pointer to the singleton */
29 static Manager* getManager();
30
31 /** This method is used to specify a builder to be used by the manager. */
32 void setBuilder(Builder * b);
33
34 /** This method start the parse of the xml file by the builder.
35 * It returns an error code (0 if all ok)
36 */
37 int build();
38
39
40 /// This method starts the visit of a hierarchy with a specified visitor
41 void startVisitor(Visitor*);
42
43 void cleanRdb();
44
45 /** This method gives back the pointer to the Rdb object. It coule be
46 used by expert clients to access information without the need of
47 a visitor */
48 Rdb* getRdb(){return m_rdb;};
49
50
51 void setInputSource(std::string pname){m_filename = pname;};
52 std::string getInputSourceString(){return m_filename;};
53
54 // There will probably be some collection of get and set services...
55
56
57 protected:
58 /** The constructor is protected; in such a way it is forbidden to *
59 build directely a manager. Here the new Rdb object is explicitely
60 built */
61 Manager():m_builder(0) {m_rdb = new Rdb;};
62
63 private:
64
65 /**
66 This is a private pointer to the Rdb object that
67 provide the entry point to all information about all tables. */
68 Rdb * m_rdb;
69 /**
70 This is the pointer to the only manager that can be instanciated */
71 static Manager* s_pMyself;
72 /** This is a private pointer to the builder used by the manager to
73 build the hierarchy from the XML file */
74 Builder * m_builder;
75
76 std::string m_filename;
77 };
78
79}
80#endif //RDBMODEL_MANAGER_H
81
void startVisitor(Visitor *)
This method starts the visit of a hierarchy with a specified visitor.
Definition Manager.cxx:53
std::string getInputSourceString()
Definition Manager.h:52
Rdb * getRdb()
Definition Manager.h:48
void setInputSource(std::string pname)
Definition Manager.h:51
void setBuilder(Builder *b)
Definition Manager.cxx:37
static Manager * getManager()
Definition Manager.cxx:24