LCCD  1.5.0
StreamerMgr.hh
1 #ifndef StreamerMgr_h
2 #define StreamerMgr_h
3 
4 #include "lccd.h"
5 #include "VCollectionStreamer.hh"
6 
7 // -- lcio headers
8 #include "lcio.h"
9 #include "EVENT/LCCollection.h"
10 
11 // -- CondDB headers
12 #include "ConditionsDB/ICondDBStreamable.h"
13 
14 // -- C++ headers
15 #include <map>
16 
17 namespace lccd {
18 
19  typedef std::map< std::string, VCollectionStreamer* > StreamerMap ;
20 
21 
29  class StreamerMgr {
30 
31  public:
32 
33  StreamerMgr() ;
34 
35  virtual ~StreamerMgr() {} ;
36 
39  static StreamerMgr* instance() ;
40 
41 
46  VCollectionStreamer* getStreamer( const std::string& type ) ;
47 
48 
52  void registerStreamer( VCollectionStreamer* streamer , const std::string& type ) ;
53 
54 
55  protected:
56 
57 
58  private:
59  StreamerMap _map{};
60 
61  static StreamerMgr* _me ;
62 
63  };
64 
65 } //end namespace
66 
67 #endif // StreamerMgr_h
68 
void registerStreamer(VCollectionStreamer *streamer, const std::string &type)
Register a streamer with the given type name.
Definition: StreamerMgr.cc:39
Manager for streamer classes of LCCollections.
Definition: StreamerMgr.hh:29
VCollectionStreamer * getStreamer(const std::string &type)
Factory method that returns a new streamer object for the given LCIO type, e.g.
Definition: StreamerMgr.cc:29
Base class for LCCollection streamer classes.
Definition: VCollectionStreamer.hh:24
static StreamerMgr * instance()
The instance of this manager class.
Definition: StreamerMgr.cc:16