RTI Connext Modern C++ API Version 7.3.0
|
Traits and operations associated to topic-types. More...
Modules | |
Topic-type serialization and deserialization | |
Provides functions to serialize and deserialize user data types to and from Common Data Representation (CDR) format. | |
Classes | |
struct | dds::topic::is_topic_type< T > |
Trait that indicates if a type is suitable to be the type of a dds::topic::Topic. More... | |
struct | dds::topic::topic_type_support< T > |
Provides convenience operations for a topic-type. More... | |
struct | dds::topic::topic_type_name< T > |
Provides the name of a topic-type. More... | |
struct | rti::topic::PrintFormatKind_def |
The definition of the dds::core::safe_enum PrintFormatKind. More... | |
class | rti::topic::PrintFormatProperty |
<<extension>> <<value-type>> A collection of attributes used to configure how data samples will be formatted when converted to a string. More... | |
struct | rti::topic::extensibility< TopicType > |
<<extension>> Indicates the extensibility kind of a topic-type More... | |
struct | rti::topic::topic_type_disabled_copy< TopicType > |
<<extension>> Indicates whether a TopicType is uncopyable More... | |
struct | rti::topic::topic_type_has_external_members< TopicType > |
<<extension>> Indicates if a topic type contains directly or indirectly IDL external members. More... | |
struct | rti::topic::dynamic_type< TopicType > |
Provides a DynamicType that represents an IDL-generated type. More... | |
Typedefs | |
typedef dds::core::safe_enum< PrintFormatKind_def > | rti::topic::PrintFormatKind |
Safe Enumeration of PrintFormatKind_def Format kinds available when converting data samples to string representations. More... | |
Functions | |
template<typename TopicType > | |
std::ostream & | rti::topic::to_string (std::ostream &out, const TopicType &sample, const PrintFormatProperty &print_format=PrintFormatProperty::Default()) |
Prints a data sample to an output stream. More... | |
template<typename TopicType > | |
std::string | rti::topic::to_string (const TopicType &sample, const PrintFormatProperty &print_format=PrintFormatProperty::Default()) |
Tranforms a data sample into a human-readable string format. More... | |
template<typename TopicType > | |
TopicType | rti::topic::from_string (RTI_STRING_IN str, PrintFormatKind format_kind=PrintFormatKind::JSON) |
Creates a data sample from a JSON string representation. More... | |
Traits and operations associated to topic-types.
Safe Enumeration of PrintFormatKind_def Format kinds available when converting data samples to string representations.
std::ostream & rti::topic::to_string | ( | std::ostream & | out, |
const TopicType & | sample, | ||
const PrintFormatProperty & | print_format = PrintFormatProperty::Default() |
||
) |
Prints a data sample to an output stream.
TopicType | A valid topic-type. Valid types are IDL-generated types that were generated with typecodes enabled, the built-in types and dds::core::xtypes::DynamicData. |
out | The output stream to print to |
sample | The sample to print to the output stream |
print_format | Properties describing the format with which to print the sample. For example, a sample may be printed in a default format, JSON format or XML format. |
Referenced by dds::topic::qos::TopicQos::operator>>().
std::string rti::topic::to_string | ( | const TopicType & | sample, |
const PrintFormatProperty & | print_format = PrintFormatProperty::Default() |
||
) |
Tranforms a data sample into a human-readable string format.
TopicType | A valid topic-type. Valid types are IDL-generated types that were generated with typecodes enabled, the built-in types and dds::core::xtypes::DynamicData. |
sample | The sample to get the string representation of |
print_format | Properties describing the format with which to print the sample. For example, a sample may be printed in a default format, JSON format or XML format. |
TopicType rti::topic::from_string | ( | RTI_STRING_IN | str, |
PrintFormatKind | format_kind = PrintFormatKind::JSON |
||
) |
Creates a data sample from a JSON string representation.
TopicType | An IDL-generated type, generated with typecodes enabled. |
For example:
str | The JSON string to convert to a sample |
format_kind | The only supported value is PrintFormatKind::JSON |
References dds::core::xtypes::DynamicData::from_string().