|
RTC Toolkit 5.1.0
|
Class for passing/receiving metadata to/from the repository. More...
#include <repositoryIf.hpp>
Classes | |
| class | ConstIterator |
| Constant version of the bidirectional forward iterator returned by the cbegin/cend methods. More... | |
| class | ConstReverseIterator |
| Constant version of the bidirectional reverse iterator returned by the crbegin/crend methods. More... | |
| class | ConstValueProxy |
| A read-only interface class to an underlying metadata value. More... | |
| class | Iterator |
| Bidirectional forward iterator returned by the begin/end methods. More... | |
| class | KeyAlreadyExists |
| Exception indicating that the metadata already contains the given key. More... | |
| class | KeyDoesNotExist |
| Exception indicating that the given key does not exist in the metadata. More... | |
| class | ReverseIterator |
| Bidirectional reverse iterator returned by the rbegin/rend methods. More... | |
| class | TypeMismatch |
| Exception indicating that a value with the wrong type was being assigned to a reserved key. More... | |
| class | UnsupportedType |
| Exception indicating that an unsupported type was used for the metadata value. More... | |
| class | ValueProxy |
| Interface class to an underlying metadata value. More... | |
Public Member Functions | |
| MetaData ()=default | |
| MetaData (const MetaData &rhs)=default | |
| MetaData (MetaData &&rhs)=default | |
| MetaData (std::initializer_list< std::pair< std::string, std::any > > init_list) | |
| ~MetaData ()=default | |
| MetaData & | operator= (const MetaData &rhs)=default |
| MetaData & | operator= (MetaData &&rhs)=default |
| bool | Empty () const |
| Check if the metadata contains any values. | |
| size_t | GetSize () const noexcept |
| Get the number of entries in the metadata. | |
| bool | Contains (const std::string &key) const |
| Check if the metadata contains a specific key. | |
| ValueProxy | Insert (const std::string &key) |
| Add a new metadata key. | |
| ValueProxy | Insert (std::string &&key) |
| Add a new metadata key. | |
| template<typename T > | |
| auto & | Insert (const std::string &key, T &&value) |
| Add a new metadata key with the given value. | |
| template<typename T > | |
| auto & | Insert (std::string &&key, T &&value) |
| Add a new metadata key with the given value. | |
| bool | Remove (const std::string &key) |
| Remove a metadata key. | |
| ValueProxy | operator[] (const std::string &key) |
| Return a value for the specified key. | |
| ValueProxy | operator[] (std::string &&key) |
| Return a value for the specified key. | |
| ConstValueProxy | operator[] (const std::string &key) const |
| Return a value for the specified key. | |
| void | Merge (const MetaData &source) |
| Merge entries from the source metadata object into this one. | |
| void | Merge (MetaData &&source) |
| Merge entries from the source metadata object into this one. | |
| Iterator | begin () |
| Return a forward iterator to the beginning of the metadata entries. | |
| ConstIterator | begin () const |
| Return a read-only forward iterator to the beginning of the metadata entries. | |
| ConstIterator | cbegin () const noexcept |
| Return a read-only forward iterator to the beginning of the metadata entries. | |
| Iterator | end () |
| Return a forward iterator to the end of the metadata entries. | |
| ConstIterator | end () const |
| Return a read-only forward iterator to the end of the metadata entries. | |
| ConstIterator | cend () const noexcept |
| Return a read-only forward iterator to the end of the metadata entries. | |
| ReverseIterator | rbegin () |
| Return a reverse iterator to the beginning of the metadata entries. | |
| ConstReverseIterator | rbegin () const |
| Return a read-only reverse iterator to the beginning of the metadata entries. | |
| ConstReverseIterator | crbegin () const noexcept |
| Return a read-only reverse iterator to the beginning of the metadata entries. | |
| ReverseIterator | rend () |
| Return a reverse iterator to the end of the metadata entries. | |
| ConstReverseIterator | rend () const |
| Return a read-only reverse iterator to the end of the metadata entries. | |
| ConstReverseIterator | crend () const noexcept |
| Return a read-only reverse iterator to the end of the metadata entries. | |
Class for passing/receiving metadata to/from the repository.
This class behaves like a std::map in most regards, but checks that only supported metadata types can be stored. Specifically, the reserved keys are checked to make sure that only the correct type can be assigned to them.
The following is a list of reserved metadata keys and their corresponding types:
const std::type_info& RtcVectorUInt64 Timestamp RtcUInt64 DataPointPath std::set<DataPointPath> The indicated types should be used when casting the metadata value for the corresponding reserved key. For example:
|
default |
|
default |
| rtctk::componentFramework::RepositoryIf::MetaData::MetaData | ( | std::initializer_list< std::pair< std::string, std::any > > | init_list | ) |
|
default |
|
inline |
Return a forward iterator to the beginning of the metadata entries.
|
inline |
Return a read-only forward iterator to the beginning of the metadata entries.
|
inlinenoexcept |
Return a read-only forward iterator to the beginning of the metadata entries.
|
inlinenoexcept |
Return a read-only forward iterator to the end of the metadata entries.
|
inline |
Check if the metadata contains a specific key.
| [in] | key | The name of the metadata entry to look for. |
true if the metadata object contains the given key and false otherwise.
|
inlinenoexcept |
Return a read-only reverse iterator to the beginning of the metadata entries.
|
inlinenoexcept |
Return a read-only reverse iterator to the end of the metadata entries.
|
inline |
Check if the metadata contains any values.
true if there is at least one key in the metadata and false otherwise.
|
inline |
Return a forward iterator to the end of the metadata entries.
|
inline |
Return a read-only forward iterator to the end of the metadata entries.
|
inlinenoexcept |
Get the number of entries in the metadata.
| RepositoryIf::MetaData::ValueProxy rtctk::componentFramework::RepositoryIf::MetaData::Insert | ( | const std::string & | key | ) |
Add a new metadata key.
| [in] | key | The new key to add. |
| KeyAlreadyExists | If the metadata already contains key. |
| auto & rtctk::componentFramework::RepositoryIf::MetaData::Insert | ( | const std::string & | key, |
| T && | value ) |
Add a new metadata key with the given value.
| T | The type of the new value being added. |
| [in] | key | The new key to add. |
| [in] | value | The value of the new key. |
| KeyAlreadyExists | If the metadata already contains key. |
| RepositoryIf::MetaData::ValueProxy rtctk::componentFramework::RepositoryIf::MetaData::Insert | ( | std::string && | key | ) |
Add a new metadata key.
| [in] | key | The new key to add. |
| KeyAlreadyExists | If the metadata already contains key. |
| auto & rtctk::componentFramework::RepositoryIf::MetaData::Insert | ( | std::string && | key, |
| T && | value ) |
Add a new metadata key with the given value.
| T | The type of the new value being added. |
| [in] | key | The new key to add. |
| [in] | value | The value of the new key. |
| KeyAlreadyExists | If the metadata already contains key. |
Merge entries from the source metadata object into this one.
| [in] | source | The metadata object to merge from. |
Merge entries from the source metadata object into this one.
source metadata object are moved into this one. Therefore the moved keys will no longer exist in source. This behavior is similar to std::map::merge.| [in,out] | source | The metadata object to merge from. |
|
default |
| RepositoryIf::MetaData::ValueProxy rtctk::componentFramework::RepositoryIf::MetaData::operator[] | ( | const std::string & | key | ) |
Return a value for the specified key.
Insert a new key if necessary.
| [in] | key | The key to search for. |
| RepositoryIf::MetaData::ConstValueProxy rtctk::componentFramework::RepositoryIf::MetaData::operator[] | ( | const std::string & | key | ) | const |
Return a value for the specified key.
| [in] | key | The key to search for. |
| KeyDoesNotExist | If the metadata does not contain key. |
| RepositoryIf::MetaData::ValueProxy rtctk::componentFramework::RepositoryIf::MetaData::operator[] | ( | std::string && | key | ) |
Return a value for the specified key.
Insert a new key if necessary.
| [in] | key | The key to search for. |
|
inline |
Return a reverse iterator to the beginning of the metadata entries.
|
inline |
Return a read-only reverse iterator to the beginning of the metadata entries.
Remove a metadata key.
| [in] | key | The new key to add. |
true if the metadata actually contained the key and false otherwise.
|
inline |
Return a reverse iterator to the end of the metadata entries.
|
inline |
Return a read-only reverse iterator to the end of the metadata entries.