|
RTC Toolkit 5.1.0
|
Interface class to an underlying metadata value. More...
#include <repositoryIf.hpp>
Public Member Functions | |
| ValueProxy ()=delete | |
| ValueProxy (const ValueProxy &rhs)=default | |
| ValueProxy (ValueProxy &&rhs)=default | |
| ~ValueProxy ()=default | |
| bool | HasValue () const noexcept |
| Check if a value was assigned to the metadata value. | |
| const std::type_info & | GetValueType () const noexcept |
| Get the type of the metadata value stored. | |
| operator const std::any & () const | |
Cast operator to return a read-only reference to the underling std::any value object. | |
| template<typename T > | |
| T & | Cast () |
| Cast the value to the given C++ type. | |
| template<typename T > | |
| const T & | Cast () const |
| Cast the value to the given C++ type. | |
| ValueProxy & | operator= (const ValueProxy &rhs) |
| Assign a new value to this object from an existing metadata value. | |
| template<typename T > | |
| ValueProxy & | operator= (T &&rhs) |
| Assign a new value to this object. | |
| void | Reset () noexcept |
| Delete the value assigned to this metadata value. | |
| template<typename T > | |
| RepositoryIf::MetaData::ValueProxy & | operator= (T &&rhs) |
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.
|
default |
|
default |
|
default |
| T & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::Cast | ( | ) |
Cast the value to the given C++ type.
true. | T | The type to cast the value to. |
| std::bad_any_cast | If the metadata cannot be cast to the given type T. |
| const T & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::Cast | ( | ) | const |
Cast the value to the given C++ type.
true. | T | The type to cast the value to. |
| std::bad_any_cast | If the metadata cannot be cast to the given type T. |
|
noexcept |
Get the type of the metadata value stored.
typeid of the C++ object type stored in the value.
|
inlinenoexcept |
Check if a value was assigned to the metadata value.
true if the value referred to by this proxy object actually has a value assigned and false if it does not.
|
inline |
Cast operator to return a read-only reference to the underling std::any value object.
| RepositoryIf::MetaData::ValueProxy & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::operator= | ( | const ValueProxy & | rhs | ) |
Assign a new value to this object from an existing metadata value.
| [in] | rhs | The existing metadata value to assign from. |
this object. | TypeMismatch | If trying to assign a value with the wrong type for a reserved metadata key. |
| ValueProxy & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::operator= | ( | T && | rhs | ) |
Assign a new value to this object.
| T | The type of the new value being assigned. Can be std::any in which case runtime type checks are performed. |
| [in] | rhs | The new value to assign. |
this object. | 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. |
| RepositoryIf::MetaData::ValueProxy & rtctk::componentFramework::RepositoryIf::MetaData::ValueProxy::operator= | ( | T && | rhs | ) |
|
inlinenoexcept |
Delete the value assigned to this metadata value.
HasValue will return false after calling this method.