LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
SIOHandlerMgr.h
1 #ifndef SIO_SIOHANDLERMGR_H
2 #define SIO_SIOHANDLERMGR_H 1
3 
4 #include<map>
5 #include<string>
6 #include "SIO/SIOObjectHandler.h"
7 
8 
9 namespace SIO {
10 
11  typedef std::map< std::string, SIOObjectHandler* > SIOHandlerMap ;
12 
19  class SIOHandlerMgr {
20 
21  private:
22 
23  SIOHandlerMgr() ; // no public c'tor for a singleton
24 
25  public:
26 
27  ~SIOHandlerMgr() ;
28 
31  static SIOHandlerMgr* instance() ;
32 
35  SIOObjectHandler* getHandler( const std::string& type ) ;
36 
40  bool registerHandler( const std::string& type, SIOObjectHandler* handler ) ;
41 
42 
43  private:
44 
45  SIOHandlerMap _map ;
46 
47  static SIOHandlerMgr* _me ;
48 
49 
50  }; // class
51 
52 } // namespace
53 #endif /* ifndef SIO_SIOHANDLERMGR_H */
bool registerHandler(const std::string &type, SIOObjectHandler *handler)
Registers an instance of a handler for the given type.
Definition: SIOHandlerMgr.cc:90
static SIOHandlerMgr * instance()
Returns the instance of this class.
Definition: SIOHandlerMgr.cc:73
Interface for all lcio object SIO-handlers, has to be implemented for all event entities (hits...
Definition: SIOObjectHandler.h:21
Singleton that holds instances of all types of SIOObjectHandlers.
Definition: SIOHandlerMgr.h:19
SIOObjectHandler * getHandler(const std::string &type)
Returns the instance of the handler for the given type - null if it doesn't exist.
Definition: SIOHandlerMgr.cc:81