rdbModel::Manager Class Reference

#include <Manager.h>

List of all members.

Public Member Functions

 ~Manager ()
void setBuilder (Builder *b)
int build ()
void startVisitor (Visitor *)
 This method starts the visit of a hierarchy with a specified visitor.
void cleanRdb ()
RdbgetRdb ()
void setInputSource (std::string pname)
std::string getInputSourceString ()

Static Public Member Functions

static ManagergetManager ()

Protected Member Functions

 Manager ()

Private Attributes

Rdbm_rdb
Builderm_builder
std::string m_filename

Static Private Attributes

static Managers_pMyself = 0


Detailed Description

This class implement the manager for the sections part of the XML file. It is a singleton.
Author:
D.Favretto & R.Giannitrapani

Definition at line 18 of file Manager.h.


Constructor & Destructor Documentation

rdbModel::Manager::~Manager (  ) 

The destructor must be invoched by the client before leaving the application. It will destroy explicitely the Rdb object and this will start the deallocation of all the objects hierarchy

Definition at line 18 of file Manager.cxx.

References m_builder, m_rdb, and s_pMyself.

00018                    {
00019     delete m_rdb;
00020     delete m_builder;
00021     s_pMyself = 0;
00022   }

rdbModel::Manager::Manager (  )  [inline, protected]

The constructor is protected; in such a way it is forbidden to * build directely a manager. Here the new Rdb object is explicitely built

Definition at line 61 of file Manager.h.

References m_rdb.

00061 :m_builder(0)  {m_rdb = new Rdb;};


Member Function Documentation

int rdbModel::Manager::build (  ) 

This method start the parse of the xml file by the builder. It returns an error code (0 if all ok)

Definition at line 43 of file Manager.cxx.

References rdbModel::Builder::buildRdb(), m_builder, m_filename, and rdbModel::Builder::parseInput().

Referenced by calibUtil::Metadata::compareSchema(), and main().

00043                      {
00044     int errCode = m_builder->parseInput(m_filename);
00045 
00046     // Unlike geometry description/detModel, there is only one way to 
00047     // build here: build everything.
00048     if (!errCode) {
00049       return m_builder->buildRdb();
00050     }
00051     else return errCode;
00052   }

void rdbModel::Manager::cleanRdb (  ) 

Definition at line 31 of file Manager.cxx.

References m_rdb.

00031                         {
00032     delete m_rdb; 
00033     m_rdb = new Rdb; 
00034     //  delete manBuilder;
00035   }

std::string rdbModel::Manager::getInputSourceString (  )  [inline]

Definition at line 52 of file Manager.h.

References m_filename.

00052 {return m_filename;};

Manager * rdbModel::Manager::getManager (  )  [static]

This method is used to access the pointer to the singleton

Definition at line 24 of file Manager.cxx.

References s_pMyself.

Referenced by rdbModel::XercesBuilder::buildRdb(), calibUtil::Metadata::compareSchema(), and main().

00025   {
00026     if (s_pMyself == 0)
00027       s_pMyself = new Manager;
00028     return s_pMyself;
00029   }

Rdb* rdbModel::Manager::getRdb (  )  [inline]

This method gives back the pointer to the Rdb object. It coule be used by expert clients to access information without the need of a visitor

Definition at line 48 of file Manager.h.

References m_rdb.

Referenced by rdbModel::XercesBuilder::buildRdb(), calibUtil::Metadata::compareSchema(), and main().

00048 {return m_rdb;};

void rdbModel::Manager::setBuilder ( Builder b  ) 

This method is used to specify a builder to be used by the manager.

Definition at line 37 of file Manager.cxx.

References m_builder.

Referenced by calibUtil::Metadata::compareSchema(), and main().

00038   {
00039     m_builder = b;
00040   
00041   }

void rdbModel::Manager::setInputSource ( std::string  pname  )  [inline]

Definition at line 51 of file Manager.h.

References m_filename.

Referenced by calibUtil::Metadata::compareSchema(), and main().

00051 {m_filename = pname;};

void rdbModel::Manager::startVisitor ( Visitor  ) 

This method starts the visit of a hierarchy with a specified visitor.

Definition at line 53 of file Manager.cxx.

References rdbModel::Rdb::accept(), m_rdb, and v.

00054   {
00055     //    if (TablesVisitor* tv = dynamic_cast<TablesVisitor*>(v))      
00056     //    {   // the only kind we support, at least for now
00057       
00058     //      if (v->getRecursive())
00059         m_rdb->accept(v);
00060         //      else
00061         //        m_rdb->acceptNotRec(sv);
00062         //    }
00063   }


Member Data Documentation

Builder* rdbModel::Manager::m_builder [private]

This is a private pointer to the builder used by the manager to build the hierarchy from the XML file

Definition at line 74 of file Manager.h.

Referenced by build(), setBuilder(), and ~Manager().

std::string rdbModel::Manager::m_filename [private]

Definition at line 76 of file Manager.h.

Referenced by build(), getInputSourceString(), and setInputSource().

Rdb* rdbModel::Manager::m_rdb [private]

This is a private pointer to the Rdb object that provide the entry point to all information about all tables.

Definition at line 61 of file Manager.h.

Referenced by cleanRdb(), getRdb(), Manager(), startVisitor(), and ~Manager().

Manager * rdbModel::Manager::s_pMyself = 0 [static, private]

This is the pointer to the only manager that can be instanciated

Definition at line 71 of file Manager.h.

Referenced by getManager(), and ~Manager().


Generated on Tue Nov 29 23:36:35 2016 for BOSS_7.0.2 by  doxygen 1.4.7