12 #include <sio/exception.h>
18 sio::block_list blocks {} ;
19 auto headerBlock = std::make_shared<SIOEventHandler>() ;
20 headerBlock->setEvent( event ) ;
22 blocks.push_back( headerBlock ) ;
23 sio::api::read_blocks( buffer, blocks ) ;
29 sio::block_list blocks {} ;
30 auto headerBlock = std::make_shared<SIOEventHandler>() ;
31 headerBlock->setEvent( event ) ;
32 blocks.push_back( headerBlock ) ;
39 sio::block_list blocks {} ;
40 auto headerBlock = std::make_shared<SIOEventHandler>() ;
41 headerBlock->setEvent( event ) ;
42 headerBlock->setCollectionNames( colsOnly ) ;
43 blocks.push_back( headerBlock ) ;
51 auto collectionNames =
event->getCollectionNames();
52 for(
auto collectionName : *collectionNames ) {
53 auto collection =
event->getCollection( collectionName ) ;
55 if( collection->isTransient() ) {
58 if( ( not colsOnly.
empty() ) and ( colsOnly.
end() == colsOnly.
find(collectionName) ) ) {
61 auto handler = handlerMgr.
getHandler( collection->getTypeName() ) ;
62 auto block = std::make_shared<SIOCollectionHandler>( collectionName, handler ) ;
63 block->setCollection( collection );
64 blocks.push_back( block ) ;
71 sio::block_list blocks {} ;
73 sio::api::read_blocks( buffer, blocks ) ;
79 sio::block_list blocks {} ;
87 sio::block_list blocks {} ;
96 sio::block_list blocks {} ;
97 auto runBlock = std::make_shared<SIORunHeaderHandler>() ;
98 runBlock->setRunHeader( rhdr ) ;
99 blocks.push_back( runBlock ) ;
100 sio::api::read_blocks( buffer, blocks ) ;
106 sio::block_list blocks {} ;
107 auto runBlock = std::make_shared<SIORunHeaderHandler>() ;
108 runBlock->setRunHeader( rhdr ) ;
109 blocks.push_back( runBlock ) ;
static constexpr const char * RunRecordName
static void writeRecord(sio::buffer &outbuf, EVENT::LCEvent *event, const SIOHandlerMgr &handlerMgr, sio::record_info &rec_info, sio::options_type opts=0)
Write an event record.
static void readBlocks(const sio::buffer_span &buffer, EVENT::LCEvent *event, const SIOHandlerMgr &handlerMgr)
Read the blocks (collections) from the sio buffer.
The main event interface.
Holds instances of all types of SIOObjectHandlers.
std::shared_ptr< SIOObjectHandler > getHandler(const std::string &type) const
Returns the instance of the handler for the given type - null if it doesn't exist.
static constexpr const char * HeaderRecordName
static void setupBlocks(EVENT::LCEvent *event, const SIOHandlerMgr &handlerMgr, sio::block_list &blocks, const std::set< std::string > &colsOnly={})
Setup the record blocks for the given event.
static constexpr const char * EventRecordName