CoreDX DDS Modern C++ API
|
This class is used to read/write data for DynamicTypes. More...
Public Member Functions | |
DynamicData (const dds::core::xtypes::DynamicType &type) | |
Creates a DynamicData instance for a type. | |
bool | operator== (const DynamicData< DELEGATE > &that) const |
Test for equality with another DynamicData instance. | |
template<typename T > | |
void | value (const std::string &name, const T &v) |
Sets the value of a member by member name. | |
template<typename T > | |
void | value (uint32_t id, const T &v) |
Sets the value of a member by member id. | |
template<typename T > | |
void | value (uint32_t id, const std::vector< T > &v) |
Sets the values of an array or sequence member by member id. | |
template<typename T > | |
void | value (const std::string &name, const std::vector< T > &v) |
Sets the values of an array or sequence member by member name. | |
template<typename T > | |
T | value (const std::string &name) const |
Gets the value of a member by member name. | |
template<typename T > | |
T | value (uint32_t id) const |
Gets the value of a member by member id. | |
template<typename T > | |
void | get_values (const std::string &name, std::vector< T > &out_array) const |
Obtains the values of an array or sequence member by member name. | |
template<typename T > | |
void | get_values (uint32_t id, std::vector< T > &out_array) const |
Obtains the values of an array or sequence member by member id. | |
template<typename T > | |
std::vector< T > | get_values (uint32_t id) const |
Obtains the values of an array or sequence member by member id. | |
template<typename T > | |
std::vector< T > | get_values (const std::string &name) const |
Obtains the values of an array or sequence member by member name. | |
LoanedDynamicData | loan_value (const std::string &name) |
Gets a view of a complex member. | |
LoanedDynamicData | loan_value (uint32_t id) |
Gets a view of a complex member. | |
LoanedDynamicData & | loan_value (LoanedDynamicData &data, const std::string &name) |
Gets a view of a complex member. | |
LoanedDynamicData & | loan_value (LoanedDynamicData &data, uint32_t id) |
Gets a view of a complex member. | |
uint32_t | discriminator_value () const |
Obtains the value of the union discriminator (UnionType only) | |
void | clear_all_members () |
Clear the contents of all data members of this object, including key members. | |
void | clear_member (const std::string &name) |
Clear the contents of a single data member of this object. | |
void | clear_member (uint32_t id) |
Clear the contents of a single data member of this object. | |
const dds::core::xtypes::DynamicType & | type () const |
Gets the data type of this DynamicData. | |
dds::core::xtypes::TypeKind | type_kind () const |
Gets the data type kind of this DynamicData. | |
uint32_t | member_count () const |
Get the number of members in this sample. | |
bool | member_exists (const std::string &name) const |
Determines if an optional member is set by member name. | |
bool | member_exists (uint32_t id) const |
Determines if an optional member is set by member id. | |
bool | member_exists_in_type (const std::string &name) const |
Indicates whether a member with a particular name exists in type() | |
bool | member_exists_in_type (uint32_t id) const |
Indicates whether a member of a particular id exists in type() | |
uint32_t | member_id (const std::string &name) const |
Translates from member name to member id. | |
Public Member Functions inherited from dds::core::Value< DELEGATE > | |
const DELEGATE * | operator-> () const |
Return the delegate. | |
DELEGATE * | operator-> () |
Return the delegate. | |
const DELEGATE & | delegate () const |
Return the delegate. | |
DELEGATE & | delegate () |
Return the delegate. | |
This class is used to read/write data for DynamicTypes.
It supports the reading and writing of samples in a type-safe manner and without compile-time knowledge of the type being read/written.