1#ifndef PODIO_COLLECTIONBASE_H
2#define PODIO_COLLECTIONBASE_H
14class ICollectionProvider;
41 virtual void setID(
unsigned id) = 0;
44 virtual unsigned getID()
const = 0;
56 virtual size_t size()
const = 0;
78 virtual void print(std::ostream& os = std::cout,
bool flush =
true)
const = 0;
CollectionBase()=default
default constructor
virtual void clear()=0
clear the collection and all internal states
virtual void setID(unsigned id)=0
set collection ID
virtual size_t size() const =0
number of elements in the collection
CollectionBase(CollectionBase &&)=default
Move constructor.
virtual std::string getTypeName() const =0
fully qualified type name
virtual std::string getValueTypeName() const =0
fully qualified type name of elements - with namespace
virtual void prepareAfterRead()=0
re-create collection from buffers after read
virtual size_t getDatamodelRegistryIndex() const =0
Get the index in the DatatypeRegistry of the EDM this collection belongs to.
virtual void prepareForWrite() const =0
prepare buffers for serialization
CollectionBase(const CollectionBase &)=delete
No copy c'tor because collections are move-only.
virtual bool isSubsetCollection() const =0
check if this collection is a subset collection
virtual unsigned getID() const =0
get collection ID
virtual bool setReferences(const ICollectionProvider *collectionProvider)=0
initialize references after read
virtual podio::CollectionWriteBuffers getBuffers()=0
Get the collection buffers for this collection.
CollectionBase & operator=(CollectionBase &&)=default
Move assignment.
virtual std::string getDataTypeName() const =0
fully qualified type name of stored POD elements - with namespace
virtual void setSubsetCollection(bool setSubset=true)=0
declare this collection to be a subset collection
virtual ~CollectionBase()=default
destructor
virtual bool isValid() const =0
check for validity of the container after read
virtual void print(std::ostream &os=std::cout, bool flush=true) const =0
print this collection to the passed stream
virtual podio::CollectionReadBuffers createBuffers()=0
Create (empty) collection buffers from which a collection can be constructed.
CollectionBase & operator=(const CollectionBase &)=delete
No copy assignment because collections are move-only.