LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIOObjectHandler.cc
Go to the documentation of this file.
1 #include "SIO/SIOObjectHandler.h"
2 #include "SIO/SIOLCParameters.h"
3 
4 // -- sio headers
5 #include <sio/io_device.h>
6 #include <sio/version.h>
7 
8 namespace SIO {
9 
11  _collectionType( colType ) {
12  /* nop */
13  }
14 
15  //----------------------------------------------------------------------------
16 
17  unsigned int SIOObjectHandler::flag() const {
18  return _flag ;
19  }
20 
21  //----------------------------------------------------------------------------
22 
24  return _collectionType ;
25  }
26 
27  //----------------------------------------------------------------------------
28 
29  void SIOObjectHandler::initReading( sio::read_device &device, EVENT::LCCollection *collection, sio::version_type vers ) {
30  SIO_SDATA( device , _flag ) ;
31  collection->setFlag( _flag ) ;
32  if( vers > SIO_VERSION_ENCODE( 1, 1 ) ) {
33  SIOLCParameters::read( device, collection->parameters(), vers ) ;
34  }
35  }
36 
37  //----------------------------------------------------------------------------
38 
39  void SIOObjectHandler::initWriting( sio::write_device &device, EVENT::LCCollection *collection ) {
40  _flag = collection->getFlag() ;
41  SIO_SDATA( device , _flag ) ;
42  SIOLCParameters::write( device , collection->getParameters() ) ;
43  }
44 
45 }
static void write(sio::write_device &device, const EVENT::LCParameters &params)
Writes lcio objects to an SIO stream.
virtual void setFlag(int flag)=0
Set the flag word.
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.
unsigned int flag() const
Get the collection flag.
virtual int getFlag() const =0
Returns flag word for collection.
virtual void initWriting(sio::write_device &device, EVENT::LCCollection *collection)
Init collection writing.
virtual LCParameters & parameters()=0
Parameters defined for this collection.
The generic collection used in LCIO.
Definition: LCCollection.h:29
static void read(sio::read_device &device, EVENT::LCParameters &params, sio::version_type vers)
Reads objects from an SIO stream.
SIOObjectHandler(const std::string &colType)
Constructor with collection type.
const std::string _collectionType
The collection type associated to LCIO object.
virtual const LCParameters & getParameters() const =0
Parameters defined for this collection.
const std::string & collectionType() const
Get the collection type associated to the object handler (see EVENT/LCIO.h)