Class MetadataStore

Class Documentation

class MetadataStore

Collection of metadata entries, used as metadata provider in Reader and Writer.

Provide functions to retrieve concrete metadata types by id or by type.

Also can serialize itself to Flatbuffers collection of metadata.

Public Types

using key_type = MetadataEntriesMap::key_type

Type alias for the metadata key used in the store.

Maps a metadata ID to its corresponding metadata entry.

Public Functions

uint32_t add(MetadataEntry &&entry)

Add a specified MetadataEntry to the store.

Parameters:

entry[in] – The entry to add to the store.

Returns:

The metadata id of the entry added.

uint32_t add(MetadataEntry &entry)

Add a specified MetadataEntry to the store.

Parameters:

entry[in] – The entry to add to the store.

Returns:

The metadata id of the entry added.

template<class MetadataEntryClass>
inline std::shared_ptr<MetadataEntryClass> get() const

Get the first specified MetadataEntry associated to the template parameter.

Template Parameters:

MetadataEntryClass – The metadata cpp type to try and retrieve.

Returns:

The MetadataEntry of type MetadataEntryClass if it exists.

template<class MetadataEntryClass>
inline size_t count() const

Count the number of specified MetadataEntry associated to the template parameter.

Template Parameters:

MetadataEntryClass – The metadata cpp type to try and count.

Returns:

The count type MetadataEntryClass.

template<class MetadataEntryClass>
inline std::shared_ptr<MetadataEntryClass> get(const uint32_t metadata_id) const

Get the specified MetadataEntry associated to the template parameter and metadata_id.

Template Parameters:

MetadataEntryClass – The metadata cpp type to try and retrieve.

Parameters:

metadata_id[in] The id to try and return the associated entry.

Returns:

The MetadataEntryClass.

inline std::shared_ptr<MetadataEntry> get(const uint32_t metadata_id) const

Get the specified MetadataEntry associated to the metadata_id.

Parameters:

metadata_id[in] – The id to try and return the associated entry.

Returns:

The MetadataEntry.

template<class MetadataEntryClass>
inline std::map<uint32_t, std::shared_ptr<MetadataEntryClass>> find() const

Return a map containing all of the MetadataEntries that match the specified template class.

Template Parameters:

MetadataEntryClass – The metadata cpp type to try and retrieve.

Returns:

The MetadataEntry map.

size_t size() const

Return the number of MetadataEntries.

Returns:

The number of MetadataEntry objects.

const MetadataEntriesMap &entries() const

Return the entire map of MetadataEntry.

Returns:

The entire map of MetadataEnty objects.