PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
podio::SIOFrameData Class Reference

#include <SIOFrameData.h>

Public Member Functions

 SIOFrameData ()=delete
 
 ~SIOFrameData ()=default
 
 SIOFrameData (const SIOFrameData &)=delete
 
SIOFrameDataoperator= (const SIOFrameData &)=delete
 
 SIOFrameData (SIOFrameData &&)=default
 
SIOFrameDataoperator= (SIOFrameData &&)=default
 
 SIOFrameData (sio::buffer &&collBuffers, std::size_t dataSize, sio::buffer &&tableBuffer, std::size_t tableSize)
 
std::optional< podio::CollectionReadBuffersgetCollectionBuffers (const std::string &name)
 
podio::CollectionIDTable getIDTable ()
 
std::unique_ptr< podio::GenericParametersgetParameters ()
 
std::vector< std::string > getAvailableCollections ()
 

Detailed Description

The Frame data container for the SIO backend. It is constructed from the compressed sio::buffers that is read from file and does all the necessary unpacking and decompressing internally after construction.

Definition at line 24 of file SIOFrameData.h.

Constructor & Destructor Documentation

◆ SIOFrameData() [1/4]

podio::SIOFrameData::SIOFrameData ( )
delete

◆ ~SIOFrameData()

podio::SIOFrameData::~SIOFrameData ( )
default

◆ SIOFrameData() [2/4]

podio::SIOFrameData::SIOFrameData ( const SIOFrameData )
delete

◆ SIOFrameData() [3/4]

podio::SIOFrameData::SIOFrameData ( SIOFrameData &&  )
default

◆ SIOFrameData() [4/4]

podio::SIOFrameData::SIOFrameData ( sio::buffer &&  collBuffers,
std::size_t  dataSize,
sio::buffer &&  tableBuffer,
std::size_t  tableSize 
)
inline

Constructor from the collBuffers containing the collection data and a tableBuffer containing the necessary information for unpacking the collections. The two size parameters denote the uncompressed size of the respective buffers.

Definition at line 42 of file SIOFrameData.h.

42 :
43 m_recBuffer(std::move(collBuffers)),
44 m_tableBuffer(std::move(tableBuffer)),
45 m_dataSize(dataSize),
46 m_tableSize(tableSize) {
47 }

Member Function Documentation

◆ getAvailableCollections()

std::vector< std::string > podio::SIOFrameData::getAvailableCollections ( )

Definition at line 35 of file SIOFrameData.cc.

35 {
36 unpackBuffers();
37 std::vector<std::string> collections;
38 for (size_t i = 0; i < m_blocks.size(); ++i) {
39 if (m_availableBlocks[i]) {
40 collections.push_back(m_idTable.name(i));
41 }
42 }
43
44 return collections;
45}
const std::string name(int collectionID) const
return name for given collection ID

◆ getCollectionBuffers()

std::optional< podio::CollectionReadBuffers > podio::SIOFrameData::getCollectionBuffers ( const std::string &  name)

Definition at line 10 of file SIOFrameData.cc.

10 {
11 unpackBuffers();
12
13 if (m_idTable.present(name)) {
14 // The collections that we read are not necessarily in the same order as
15 // they are in the collection id table. Hence, we cannot simply use the
16 // collection ID to index into the blocks
17 const auto& names = m_idTable.names();
18 const auto nameIt = std::find(std::begin(names), std::end(names), name);
19 // collection indices start at 1!
20 const auto index = std::distance(std::begin(names), nameIt) + 1;
21
22 m_availableBlocks[index] = 1;
23 return {dynamic_cast<podio::SIOBlock*>(m_blocks[index].get())->getBuffers()};
24 }
25
26 return std::nullopt;
27}
bool present(const std::string &name) const
Check if collection name is known.
const std::vector< std::string > & names() const
return registered names
Base class for sio::block handlers used with PODIO.
Definition: SIOBlock.h:60

◆ getIDTable()

podio::CollectionIDTable podio::SIOFrameData::getIDTable ( )
inline

Definition at line 51 of file SIOFrameData.h.

51 {
52 if (m_idTable.empty()) {
53 readIdTable();
54 }
55 return {m_idTable.ids(), m_idTable.names()};
56 }
bool empty() const
Does this table hold any information?
const std::vector< int > & ids() const
return the ids

◆ getParameters()

std::unique_ptr< podio::GenericParameters > podio::SIOFrameData::getParameters ( )

Definition at line 29 of file SIOFrameData.cc.

29 {
30 unpackBuffers();
31 m_availableBlocks[0] = 0;
32 return std::make_unique<podio::GenericParameters>(std::move(m_parameters));
33}

◆ operator=() [1/2]

SIOFrameData & podio::SIOFrameData::operator= ( const SIOFrameData )
delete

◆ operator=() [2/2]

SIOFrameData & podio::SIOFrameData::operator= ( SIOFrameData &&  )
default

The documentation for this class was generated from the following files: