Built-in type consisting of a single character string.
More...
#include <dds/core/BuiltinTopicTypes.hpp>
Built-in type consisting of a single character string.
- See also
- Built-in Types
◆ StringTopicType() [1/4]
dds::core::StringTopicType::StringTopicType |
( |
| ) |
|
|
inline |
Creates a sample containing an empty string.
◆ StringTopicType() [2/4]
◆ StringTopicType() [3/4]
dds::core::StringTopicType::StringTopicType |
( |
const std::string & |
the_data | ) |
|
|
inline |
Creates a sample from a std::string.
Note that this constructor is implicit so you can use an std::string wherever a StringTopicType instance is expected, for example:
writer.write(str);
<<reference-type>> Allows an application to publish data for a dds::topic::Topic
Definition: TDataWriter.hpp:58
basic_string< char, rti::core::memory::OsapiAllocator< char > > string
A string convertible to std::string and with similar functionality.
Definition: String.hpp:266
- Parameters
-
the_data | The string to be copied to create this instance |
◆ StringTopicType() [4/4]
dds::core::StringTopicType::StringTopicType |
( |
const char * |
the_data | ) |
|
|
inline |
Creates an instance from a char*.
Note that this constructor is implicit so you can use an char* wherever a StringTopicType instance is expected, for example:
writer.write("Hello, World!");
- Parameters
-
the_data | The string to be copied to create this instance |
◆ operator std::string()
dds::core::StringTopicType::operator std::string |
( |
| ) |
const |
|
inline |
Automatic conversion to std::string.
- Returns
- A copy of the string
◆ operator dds::core::string &()
◆ operator const dds::core::string &()
◆ data() [1/3]
Gets the string.
- Returns
- A const-reference to the string
◆ data() [2/3]
Gets the string.
- Returns
- A reference to the string
◆ data() [3/3]