BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/rdbModel/include/rdbModel/Management/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
2// 2005/10/17 06:10:53 maqm Exp $
3#ifndef RDBMODEL_MANAGER_H
4#define RDBMODEL_MANAGER_H
5// #include <map>
6
7#include "rdbModel/Management/Visitor.h"
8#include "rdbModel/Rdb.h"
9
10namespace rdbModel {
11
12 class Builder;
13
14 /**
15 * This class implement the manager for the sections part of the XML file.
16 * It is a singleton.
17 * @author D.Favretto & R.Giannitrapani
18 */
19 class Manager {
20 public:
21 // enum buildType{all,constants,sections,materials,idDictionary};
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 /// This method starts the visit of a hierarchy with a specified visitor
40 void startVisitor( Visitor* );
41
42 void cleanRdb();
43
44 /** This method gives back the pointer to the Rdb object. It coule be
45 used by expert clients to access information without the need of
46 a visitor */
47 Rdb* getRdb() { return m_rdb; };
48
49 void setInputSource( std::string pname ) { m_filename = pname; };
50 std::string getInputSourceString() { return m_filename; };
51
52 // There will probably be some collection of get and set services...
53
54 protected:
55 /** The constructor is protected; in such a way it is forbidden to *
56 build directely a manager. Here the new Rdb object is explicitely
57 built */
58 Manager() : m_builder( 0 ) { m_rdb = new Rdb; };
59
60 private:
61 /**
62 This is a private pointer to the Rdb object that
63 provide the entry point to all information about all tables. */
64 Rdb* m_rdb;
65 /**
66 This is the pointer to the only manager that can be instanciated */
67 static Manager* s_pMyself;
68 /** This is a private pointer to the builder used by the manager to
69 build the hierarchy from the XML file */
70 Builder* m_builder;
71
72 std::string m_filename;
73 };
74
75} // namespace rdbModel
76#endif // RDBMODEL_MANAGER_H
void startVisitor(Visitor *)
This method starts the visit of a hierarchy with a specified visitor.
Definition Manager.cxx:45
void setBuilder(Builder *b)
Definition Manager.cxx:35
static Manager * getManager()
Definition Manager.cxx:24