Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:09

0001 #ifndef PODIO_ROOTFRAMEDATA_H
0002 #define PODIO_ROOTFRAMEDATA_H
0003 
0004 #include "podio/CollectionBuffers.h"
0005 #include "podio/CollectionIDTable.h"
0006 #include "podio/GenericParameters.h"
0007 
0008 #include <memory>
0009 #include <optional>
0010 #include <string>
0011 #include <unordered_map>
0012 
0013 namespace podio {
0014 
0015 class ROOTFrameData {
0016   using CollIDPtr = std::shared_ptr<const podio::CollectionIDTable>;
0017 
0018 public:
0019   using BufferMap = std::unordered_map<std::string, podio::CollectionReadBuffers>;
0020 
0021   ROOTFrameData() = delete;
0022   ~ROOTFrameData();
0023   ROOTFrameData(ROOTFrameData&&) = default;
0024   ROOTFrameData& operator=(ROOTFrameData&&) = default;
0025   ROOTFrameData(const ROOTFrameData&) = delete;
0026   ROOTFrameData& operator=(const ROOTFrameData&) = delete;
0027 
0028   ROOTFrameData(BufferMap&& buffers, CollIDPtr&& idTable, podio::GenericParameters&& params);
0029 
0030   std::optional<podio::CollectionReadBuffers> getCollectionBuffers(const std::string& name);
0031 
0032   podio::CollectionIDTable getIDTable() const;
0033 
0034   std::unique_ptr<podio::GenericParameters> getParameters();
0035 
0036   std::vector<std::string> getAvailableCollections() const;
0037 
0038 private:
0039   // TODO: switch to something more elegant once the basic functionality and
0040   // interface is better defined
0041   BufferMap m_buffers{};
0042   // This is co-owned by each FrameData and the original reader. (for now at least)
0043   CollIDPtr m_idTable{nullptr};
0044   podio::GenericParameters m_parameters{};
0045 };
0046 
0047 } // namespace podio
0048 
0049 #endif // PODIO_ROOTFRAMEDATA_H