RTI Connext Modern C++ API
Version 5.2.0
|
<<value-type>> Represents and IDL struct
type
More...
#include <dds/core/xtypes/StructType.hpp>
Public Member Functions | |
StructType (const std::string &name) | |
Creates an empty struct type. | |
StructType (const std::string &name, const StructType &parent) | |
Creates an empty struct type with a base type. | |
template<typename Container > | |
StructType (const std::string &name, const Container &members) | |
Creates a struct with the members in a container. | |
template<typename Container > | |
StructType (const std::string &name, const StructType &parent, const Container &members) | |
Creates a struct with a base type and the members in a container. | |
template<typename MemberIter > | |
StructType (const std::string &name, MemberIter begin, MemberIter end) | |
Creates a struct with the members in an iterator range. | |
template<typename MemberIter > | |
StructType (const std::string &name, const StructType &parent, MemberIter begin, MemberIter end) | |
Creates a struct with a base type and the members in an iterator range. | |
StructType (const std::string &name, StructType &&parent) | |
<<C++11>> Creates an empty struct type with a base type. | |
template<typename MemberIter > | |
StructType (const std::string &name, StructType &&parent, MemberIter begin, MemberIter end) | |
<<C++11>> Creates an empty struct type with a base type and the members in an iterator range. | |
template<typename Container > | |
StructType (const std::string &name, StructType &&parent, const Container &members) | |
<<C++11>> Creates an empty struct type with a base type and the members in a container. | |
StructType (const std::string &name, std::initializer_list< MemberImpl > members) | |
<<C++11>> Creates a struct with the members in an initializer_list | |
StructType (const std::string &name, const StructType &parent, std::initializer_list< MemberImpl > members) | |
<<C++11>> Creates a struct with the members in an initializer_list and a base type | |
StructType (const std::string &name, StructType &&parent, std::initializer_list< MemberImpl > members) | |
<<C++11>> Creates a struct with the members in an initializer_list and a base type | |
StructType & | extensibility_kind (dds::core::xtypes::ExtensibilityKind kind) |
Sets the type extensibility kind. | |
bool | has_parent () const |
Indicates if this type has a base type. | |
const StructType & | parent () const |
Retrieves the base type. | |
MemberIndex | find_member_by_id (uint32_t id) const |
Gets the index of the member with a specific member ID. | |
StructType & | add_member (const MemberImpl &member) |
Adds a member at the end. | |
template<typename Container > | |
StructType & | add_members (const Container &members) |
Adds all the members of a container at the end. | |
StructType & | add_members (std::initializer_list< MemberImpl > members) |
<<C++11>> Adds all the members of an initializer_list at the end | |
template<typename MemberIter > | |
StructType & | add_members (MemberIter begin, MemberIter end) |
Adds all the members in an iterator range at the end. | |
StructType & | add_member (MemberImpl &&member) |
<<C++11>> Adds a member, moving it, at the end | |
Public Member Functions inherited from dds::core::xtypes::AbstractConstructedType< Member > | |
dds::core::xtypes::ExtensibilityKind | extensibility_kind () const |
Gets the extensibility kind. | |
size_t | member_count () const |
Gets the number of members. | |
const Member & | member (MemberIndex index) const |
Gets a member by its index. | |
const Member & | member (const std::string &name) const |
Gets a member by its name. | |
MemberIndex | find_member_by_name (const std::string &name) const |
Obtains the member index from its name. | |
std::vector< Member > | members () const |
Gets a copy of all the members. | |
Public Member Functions inherited from dds::core::xtypes::DynamicType | |
dds::core::xtypes::TypeKind | kind () const |
Gets the type kind. | |
std::string | name () const |
Gets the name. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename... Types> | |
dds::core::xtypes::StructType | create_type_from_tuple (const std::string &name) |
<<C++11>> <<experimental>> <<extension>> Creates a StructType from a list of types or a std::tuple | |
Additional Inherited Members | |
Public Types inherited from dds::core::xtypes::AbstractConstructedType< Member > | |
typedef Member | Member |
The member type (specified by the subclasses of this class) | |
typedef uint32_t | MemberIndex |
The meber index type. | |
Static Public Attributes inherited from dds::core::xtypes::AbstractConstructedType< Member > | |
static OMG_DDS_API_CLASS_VARIABLE const MemberIndex | INVALID_INDEX |
Indicates that a member doesn't exist. | |
<<value-type>> Represents and IDL struct
type
dds::core::xtypes::StructType::StructType | ( | const std::string & | name | ) |
Creates an empty struct type.
The struct doesn't have a base type. Members can be added after creation.
name | The name of the type |
dds::core::xtypes::StructType::StructType | ( | const std::string & | name, |
const StructType & | parent | ||
) |
Creates an empty struct type with a base type.
Members can be added after creation.
name | The name of the type |
parent | The base type |
|
inline |
Creates a struct with the members in a container.
The struct doesn't have a base type.
Container | A container that provides the member functions begin() and end() to iterate over Member elements. |
name | The name of the type |
members | A container with the members for this struct type |
|
inline |
Creates a struct with a base type and the members in a container.
Container | A container that provides the member functions begin() and end() to iterate over Member elements. |
name | The name of the type |
parent | The base type |
members | A container with the members for this struct type |
|
inline |
Creates a struct with the members in an iterator range.
The struct doesn't have a base type.
MemberIter | A forward iterator of Member elements |
name | The name of the type |
begin | The beginning of the range of Members |
end | The end of the range of Members |
|
inline |
Creates a struct with a base type and the members in an iterator range.
MemberIter | A forward iterator of Member elements |
parent | The base type |
name | The name of the type |
begin | The beginning of the range of Members |
end | The end of the range of Members |
|
inline |
<<C++11>> Creates an empty struct type with a base type.
The base type is moved. This is useful to save a copy in situations like the following example:
|
inline |
<<C++11>> Creates an empty struct type with a base type and the members in an iterator range.
The base type is moved.
|
inline |
<<C++11>> Creates an empty struct type with a base type and the members in a container.
The base type is moved.
|
inline |
<<C++11>> Creates a struct with the members in an initializer_list
name | The name of the type |
members | An ininitalizer_list of Members |
|
inline |
<<C++11>> Creates a struct with the members in an initializer_list and a base type
name | The name of the type |
parent | The base type |
members | An ininitalizer_list of Members |
|
inline |
<<C++11>> Creates a struct with the members in an initializer_list and a base type
name | The name of the type |
parent | The base type (moved) |
members | An ininitalizer_list of Members |
StructType& dds::core::xtypes::StructType::extensibility_kind | ( | dds::core::xtypes::ExtensibilityKind | kind | ) |
Sets the type extensibility kind.
bool dds::core::xtypes::StructType::has_parent | ( | ) | const |
Indicates if this type has a base type.
const StructType& dds::core::xtypes::StructType::parent | ( | ) | const |
Retrieves the base type.
If this type doesn't have a base type it throws PreconditionNotMetError.
MemberIndex dds::core::xtypes::StructType::find_member_by_id | ( | uint32_t | id | ) | const |
Gets the index of the member with a specific member ID.
StructType& dds::core::xtypes::StructType::add_member | ( | const MemberImpl & | member | ) |
Adds a member at the end.
|
inline |
Adds all the members of a container at the end.
|
inline |
<<C++11>> Adds all the members of an initializer_list at the end
|
inline |
Adds all the members in an iterator range at the end.
|
inline |
<<C++11>> Adds a member, moving it, at the end
|
related |
<<C++11>> <<experimental>> <<extension>> Creates a StructType from a list of types or a std::tuple
Types | A list of types or a std::tuple. The types must be primitive (see dds::core::xtypes::PrimitiveType) or std::string . |
The StructType members are all default-created (i.e. non-key, non-optional, with default IDs...) and their names are m0, m1, m2, etc.