LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIOObjectHandler.h
Go to the documentation of this file.
1 #ifndef SIO_SIOOBJECTHANDLER_H
2 #define SIO_SIOOBJECTHANDLER_H 1
3 
4 #include "EVENT/LCObject.h"
5 #include "EVENT/LCCollection.h"
6 
7 #include <sio/definitions.h>
8 
9 namespace SIO {
10 
18 public:
20  SIOObjectHandler( const std::string &colType ) ;
21 
23  virtual ~SIOObjectHandler() = default ;
24 
26  unsigned int flag() const ;
27 
29  const std::string &collectionType() const ;
30 
32  virtual void initReading( sio::read_device &device, EVENT::LCCollection *collection, sio::version_type vers ) ;
33 
35  virtual void initWriting( sio::write_device &device, EVENT::LCCollection *collection ) ;
36 
38  virtual void read( sio::read_device& device, EVENT::LCObject* objP, sio::version_type vers ) = 0 ;
39 
41  virtual void write( sio::write_device& device, const EVENT::LCObject* obj ) = 0 ;
42 
44  virtual EVENT::LCObject *create() const = 0 ;
45 
46  protected:
50  unsigned int _flag {0} ;
51 }; // class
52 
53 } // namespace
54 #endif /* ifndef hep_lcio_event_SIOOBJECTHANDLER_H */
virtual void read(sio::read_device &device, EVENT::LCObject *objP, sio::version_type vers)=0
Reads lcio objects from an SIO stream.
The generic object that is held in an LCCollection.
Definition: LCObject.h:30
virtual ~SIOObjectHandler()=default
Default destructor.
virtual EVENT::LCObject * create() const =0
Factory method to create an object of the type of the collection.
Interface for all lcio object SIO-handlers, has to be implemented for all event entities (hits...
unsigned int _flag
The collection flag.
virtual void initReading(sio::read_device &device, EVENT::LCCollection *collection, sio::version_type vers)
Init collection reading.
STL class.
virtual void write(sio::write_device &device, const EVENT::LCObject *obj)=0
Writes lcio objects to an SIO stream.
unsigned int flag() const
Get the collection flag.
virtual void initWriting(sio::write_device &device, EVENT::LCCollection *collection)
Init collection writing.
The generic collection used in LCIO.
Definition: LCCollection.h:29
SIOObjectHandler(const std::string &colType)
Constructor with collection type.
const std::string _collectionType
The collection type associated to LCIO object.
const std::string & collectionType() const
Get the collection type associated to the object handler (see EVENT/LCIO.h)