LCCD  1.5.0
VCollectionStreamer.hh
1 #ifndef VCollectionStreamer_h
2 #define VCollectionStreamer_h
3 
4 #include "lccd.h"
5 
6 // -- lcio headers
7 #include "lcio.h"
8 #include "EVENT/LCCollection.h"
9 
10 // -- CondDB headers
11 #include "ConditionsDB/ICondDBStreamable.h"
12 
13 #include <iostream>
14 
15 namespace lccd {
16 
17 
24  class VCollectionStreamer : public ICondDBStreamable {
25 
26  public:
27 
28  VCollectionStreamer() = default ;
30  VCollectionStreamer& operator=(const VCollectionStreamer&) = delete ;
31 
32  virtual ~VCollectionStreamer() {} ;
33 
34 
37  virtual void setCollection( lcio::LCCollection* col) { _col = col ; } ;
38 
42  virtual lcio::LCCollection* getCollection() { return _col ; }
43 
47  virtual VCollectionStreamer* create()=0 ;
48 
49 
50  protected:
51 
54  virtual void writeParameters( std::string& s ) const ;
55 
58  virtual unsigned readParameters( const std::string& s , unsigned index ) ;
59 
60  lcio::LCCollection* _col = nullptr ;
61  };
62 
63 } //end namespace
64 
65 #endif // VCollectionStreamer_h
virtual void writeParameters(std::string &s) const
Write the collection&#39;s parameters to the string/stream.
Definition: VCollectionStreamer.cc:15
virtual unsigned readParameters(const std::string &s, unsigned index)
Read the collection&#39;s parameters from the stream.
Definition: VCollectionStreamer.cc:85
virtual lcio::LCCollection * getCollection()
Get the collection retrieved from the database.
Definition: VCollectionStreamer.hh:42
virtual void setCollection(lcio::LCCollection *col)
Set the collection that will be stored in the database.
Definition: VCollectionStreamer.hh:37
virtual VCollectionStreamer * create()=0
Covariant factory method.
Base class for LCCollection streamer classes.
Definition: VCollectionStreamer.hh:24