Interface class to an underlying metadata value.
More...
#include <repositoryIf.hpp>
Interface class to an underlying metadata value.
This class enforces the type checks required by MetaData to make sure only the correct types are allowed in the underling metadata mapping.
◆ ValueProxy() [1/3]
◆ ValueProxy() [2/3]
◆ ValueProxy() [3/3]
◆ ~ValueProxy()
| rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::~ValueProxy |
( |
| ) |
|
|
default |
◆ Cast() [1/2]
template<typename T>
| T & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::Cast |
( |
| ) |
|
Cast the value to the given C++ type.
- Warning
- This method should only be called if HasValue returns
true.
- Template Parameters
-
| T | The type to cast the value to. |
- Returns
- A mutable reference to the metadata value.
- Exceptions
-
| std::bad_any_cast | If the metadata cannot be cast to the given type T. |
◆ Cast() [2/2]
template<typename T>
| const T & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::Cast |
( |
| ) |
const |
Cast the value to the given C++ type.
- Warning
- This method should only be called if HasValue returns
true.
- Template Parameters
-
| T | The type to cast the value to. |
- Returns
- A read-only reference to the metadata value.
- Exceptions
-
| std::bad_any_cast | If the metadata cannot be cast to the given type T. |
◆ GetValueType()
| const std::type_info & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::GetValueType |
( |
| ) |
const |
|
noexcept |
Get the type of the metadata value stored.
- Returns
- The
typeid of the C++ object type stored in the value.
◆ HasValue()
| bool rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::HasValue |
( |
| ) |
const |
|
inlinenoexcept |
Check if a value was assigned to the metadata value.
- Returns
true if the value referred to by this proxy object actually has a value assigned and false if it does not.
◆ operator const std::any &()
| rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::operator const std::any & |
( |
| ) |
const |
|
inline |
Cast operator to return a read-only reference to the underling std::any value object.
◆ operator=() [1/3]
Assign a new value to this object from an existing metadata value.
- Parameters
-
| [in] | rhs | The existing metadata value to assign from. |
- Returns
- Reference to
this object.
- Exceptions
-
| TypeMismatch | If trying to assign a value with the wrong type for a reserved metadata key. |
◆ operator=() [2/3]
template<typename T>
| ValueProxy & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::operator= |
( |
T && | rhs | ) |
|
Assign a new value to this object.
- Template Parameters
-
| T | The type of the new value being assigned. Can be std::any in which case runtime type checks are performed. |
- Parameters
-
| [in] | rhs | The new value to assign. |
- Returns
- Reference to
this object.
- Exceptions
-
| UnsupportedType | If the type is not supported for metadata values. |
| TypeMismatch | If trying to assign a value with the wrong type for a reserved metadata key. |
◆ operator=() [3/3]
◆ Reset()
| void rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::Reset |
( |
| ) |
|
|
inlinenoexcept |
Delete the value assigned to this metadata value.
HasValue will return false after calling this method.
The documentation for this class was generated from the following files: