RTI Connext Modern C++ API  Version 6.0.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::core::StringTopicType Class Reference

Built-in type consisting of a single character string. More...

#include <dds/core/BuiltinTopicTypes.hpp>

Public Member Functions

 StringTopicType ()
 Creates a sample containing an empty string.
 
 StringTopicType (const dds::core::string &the_data)
 Creates a sample from a dds::core::string.
 
 StringTopicType (const std::string &the_data)
 Creates a sample from a std::string.
 
 StringTopicType (const char *the_data)
 Creates an instance from a char*.
 
 operator std::string () const
 Automatic conversion to std::string.
 
 operator dds::core::string & ()
 Automatic conversion to dds::core::string.
 
 operator const dds::core::string & () const
 Automatic conversion to dds::core::string.
 
const dds::core::stringdata () const
 Gets the string.
 
dds::core::stringdata ()
 Gets the string.
 
void data (const dds::core::string &value)
 Sets the string.
 

Detailed Description

Built-in type consisting of a single character string.

See Also
Built-in Types

Constructor & Destructor Documentation

dds::core::StringTopicType::StringTopicType ( )
inline

Creates a sample containing an empty string.

dds::core::StringTopicType::StringTopicType ( const dds::core::string the_data)
inline

Creates a sample from a dds::core::string.

Note that this constructor is implicit so you can use a dds::core::string wherever a StringTopicType instance is expected

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:

std::string str = "Hello World!";
writer.write(str);
Parameters
the_dataThe string to be copied to create this instance
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_dataThe string to be copied to create this instance

Member Function Documentation

dds::core::StringTopicType::operator std::string ( ) const
inline

Automatic conversion to std::string.

Returns
A copy of the string
dds::core::StringTopicType::operator dds::core::string & ( )
inline

Automatic conversion to dds::core::string.

Returns
A reference to the string
dds::core::StringTopicType::operator const dds::core::string & ( ) const
inline

Automatic conversion to dds::core::string.

Returns
A const-reference to the string
const dds::core::string& dds::core::StringTopicType::data ( ) const
inline

Gets the string.

Returns
A const-reference to the string
dds::core::string& dds::core::StringTopicType::data ( )
inline

Gets the string.

Returns
A reference to the string
void dds::core::StringTopicType::data ( const dds::core::string value)
inline

Sets the string.


RTI Connext Modern C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc