Class podio::UserDataCollection

template<typename BasicType, typename = EnableIfSupportedUserType<BasicType>>
class UserDataCollection : public podio::CollectionBase

Collection of basic types for additional user data not defined in the EDM.

The data is stored in an std::vector<basic_type>. Supported are all basic types supported in PODIO, i.e. float, double and 8-64 bit fixed size signed and unsigned integers -

See also

SupportedUserDataTypes.

Author

F.Gaede, DESY

Date

Sep 2021

Public Functions

UserDataCollection() = default
inline UserDataCollection(std::vector<BasicType> &&vec)

Constructor from an existing vector (which will be moved from!)

UserDataCollection(const UserDataCollection&) = delete
UserDataCollection &operator=(const UserDataCollection&) = delete
UserDataCollection(UserDataCollection&&) = default
UserDataCollection &operator=(UserDataCollection&&) = default
~UserDataCollection() = default
inline virtual void prepareForWrite() const override

prepare buffers for serialization

inline virtual void prepareAfterRead() override

re-create collection from buffers after read

inline virtual bool setReferences(const ICollectionProvider*) override

initialize references after read

inline virtual void setID(uint32_t id) override

set collection ID

inline virtual uint32_t getID() const override

get collection ID

inline virtual podio::CollectionWriteBuffers getBuffers() override

Get the collection buffers for this collection.

inline virtual bool isValid() const override

check for validity of the container after read

inline virtual size_t size() const override

number of elements in the collection

inline virtual bool empty() const override

Is the collection empty.

inline virtual const std::string_view getTypeName() const override

fully qualified type name

inline virtual const std::string_view getValueTypeName() const override

fully qualified type name of elements - with namespace

inline virtual const std::string_view getDataTypeName() const override

fully qualified type name of stored POD elements - with namespace

inline virtual void clear() override

clear the collection and all internal states

inline virtual bool isSubsetCollection() const override

check if this collection is a subset collection - no subset possible

inline virtual void setSubsetCollection(bool) override

declare this collection to be a subset collection - no effect

inline virtual SchemaVersionT getSchemaVersion() const final

The schema version is fixed manually.

inline virtual void print(std::ostream &os = std::cout, bool flush = true) const override

Print this collection to the passed stream.

inline virtual size_t getDatamodelRegistryIndex() const override

Get the index in the DatatypeRegistry of the EDM this collection belongs to.

inline std::vector<BasicType>::iterator begin()
inline std::vector<BasicType>::iterator end()
inline std::vector<BasicType>::const_iterator begin() const
inline std::vector<BasicType>::const_iterator end() const
inline std::vector<BasicType>::reference operator[](size_t idx)
inline std::vector<BasicType>::const_reference operator[](size_t idx) const
inline void resize(size_t count)
inline void push_back(const BasicType &value)
inline std::vector<BasicType> &vec()

access to the actual data vector

inline const std::vector<BasicType> &vec() const

const access to the actual data vector

Public Static Attributes

static constexpr SchemaVersionT schemaVersion = 1

The schema version of UserDataCollections.

static constexpr auto typeName = userDataCollTypeName<BasicType>()
static constexpr auto valueTypeName = userDataTypeName<BasicType>()
static constexpr auto dataTypeName = userDataTypeName<BasicType>()