RTI Connext Modern C++ API
Version 6.1.0
|
<<value-type>> Represents and IDL union
type
More...
#include <dds/core/xtypes/UnionType.hpp>
Public Types | |
typedef UnionMember::DiscriminatorType | DiscriminatorType |
The type used to set and get discriminator (label) values. More... | |
![]() | |
typedef UnionMember | Member |
The member type (specified by the subclasses of this class) More... | |
typedef uint32_t | MemberIndex |
The member index type. More... | |
Public Member Functions | |
UnionType (const std::string &the_name, const DynamicTypeImpl &discriminator_type) | |
Creates an empty union. More... | |
template<typename Container > | |
UnionType (const std::string &the_name, const DynamicTypeImpl &discriminator_type, const Container &the_members) | |
Creates a union with the members in a container. More... | |
template<typename MemberIter > | |
UnionType (const std::string &the_name, const DynamicTypeImpl &discriminator_type, MemberIter begin, MemberIter end) | |
Creates a union with the members in an iterator range. More... | |
UnionType (const std::string &the_name, const DynamicTypeImpl &discriminator_type, std::initializer_list< UnionMember > the_members) | |
Creates a union with the members in an initializer_list. More... | |
const DynamicTypeImpl & | discriminator () const |
Gets the type of the discriminator. More... | |
MemberIndex | find_member_by_label (DiscriminatorType label) const |
Gets the index of the member selected by a label. More... | |
MemberIndex | find_member_by_id (uint32_t id) const |
Gets the index of the member with a specific member ID. More... | |
UnionType & | add_member (const UnionMember &member) |
Add a member to the end of this union. More... | |
template<typename Container > | |
UnionType & | add_members (const Container &the_members) |
Adds all the members of a container at the end. More... | |
UnionType & | add_members (std::initializer_list< UnionMember > the_members) |
Adds all the members of an initializer_list at the end. More... | |
template<typename MemberIter > | |
UnionType & | add_members (MemberIter begin, MemberIter end) |
Adds all the members in an iterator range at the end. More... | |
UnionType & | add_member (UnionMember &&the_member) |
Adds a member, moving it, at the end. More... | |
![]() | |
dds::core::xtypes::ExtensibilityKind | extensibility_kind () const |
Gets the extensibility kind. More... | |
size_t | member_count () const |
Gets the number of members. More... | |
const UnionMember & | member (MemberIndex index) const |
Gets a member by its index. More... | |
const UnionMember & | member (const std::string &name) const |
Gets a member by its name. More... | |
MemberIndex | find_member_by_name (const std::string &name) const |
Obtains the member index from its name. More... | |
std::vector< UnionMember > | members () const |
Gets a copy of all the members. More... | |
uint32_t | cdr_serialized_sample_max_size (dds::core::policy::DataRepresentationId representation_id=DDS_AUTO_DATA_REPRESENTATION) const |
Gets the maximum serialized size of samples of this type. More... | |
uint32_t | cdr_serialized_sample_min_size (dds::core::policy::DataRepresentationId representation_id=DDS_AUTO_DATA_REPRESENTATION) const |
Gets the minimum serialized size of samples of this type. More... | |
uint32_t | cdr_serialized_sample_key_max_size (dds::core::policy::DataRepresentationId representation_id=DDS_AUTO_DATA_REPRESENTATION) const |
Gets the maximum serialized size of sample keys of this type. More... | |
![]() | |
dds::core::xtypes::TypeKind | kind () const |
Gets the type kind. More... | |
std::string | name () const |
Gets the name. More... | |
Additional Inherited Members | |
![]() | |
static OMG_DDS_API_CLASS_VARIABLE const MemberIndex | INVALID_INDEX |
Indicates that a member doesn't exist. More... | |
![]() | |
bool | is_primitive_type (const DynamicType &t) |
Determines if a DynamicType is a PrimitiveType. More... | |
bool | is_constructed_type (const DynamicType &t) |
Determines if a DynamicType is a constructed type. More... | |
bool | is_collection_type (const DynamicType &t) |
Determines if a DynamicType is a CollectionType. More... | |
bool | is_aggregation_type (const DynamicType &t) |
Determines if a DynamicType is an aggregation type. More... | |
std::ostream & | operator<< (std::ostream &out, const DynamicType &type) |
<<extension>> Converts the DynamicType to a string. More... | |
void | print_idl (const DynamicType &type, unsigned int indent=0) |
<<extension>> Prints the IDL representation of this DynamicType to the standard output More... | |
std::ostream & | to_string (std::ostream &out, const DynamicType &type, const rti::core::xtypes::DynamicTypePrintFormatProperty &format=DynamicTypePrintFormatProperty()) |
<<extension>> Writes the string representation of this DynamicType to an output stream. More... | |
std::string | to_string (const DynamicType &type, const rti::core::xtypes::DynamicTypePrintFormatProperty &format=DynamicTypePrintFormatProperty()) |
<<extension>> Creates the string representation of this DynamicType to a string. More... | |
<<value-type>> Represents and IDL union
type
typedef UnionMember::DiscriminatorType dds::core::xtypes::UnionType::DiscriminatorType |
The type used to set and get discriminator (label) values.
Note that this is different from discriminator(), which represents the discriminator type as defined in IDL.
|
inline |
Creates an empty union.
Members can be added after creation.
the_name | The name of the type |
discriminator_type | The type of the discriminator |
|
inline |
Creates a union with the members in a container.
Container | A container that provides the member functions begin() and end() to iterate over UnionMember elements. |
|
inline |
Creates a union with the members in an iterator range.
MemberIter | A forward iterator of UnionMember elements |
the_name | The name of the type |
discriminator_type | The type of the discriminator |
begin | The beginning of the range of UnionMembers |
end | The end of the range of UnionMembers |
|
inline |
Creates a union with the members in an initializer_list.
the_name | The name of the type |
discriminator_type | The type of the discriminator |
the_members | An ininitalizer_list of UnionMembers |
const DynamicTypeImpl& dds::core::xtypes::UnionType::discriminator | ( | ) | const |
Gets the type of the discriminator.
MemberIndex dds::core::xtypes::UnionType::find_member_by_label | ( | DiscriminatorType | label | ) | const |
Gets the index of the member selected by a label.
The result of this function can be passed to member(uint32_t).
MemberIndex dds::core::xtypes::UnionType::find_member_by_id | ( | uint32_t | id | ) | const |
Gets the index of the member with a specific member ID.
The result of this function can be passed to member(uint32_t).
UnionType& dds::core::xtypes::UnionType::add_member | ( | const UnionMember & | member | ) |
Add a member to the end of this union.
|
inline |
Adds all the members of a container at the end.
|
inline |
Adds all the members of an initializer_list at the end.
|
inline |
Adds all the members in an iterator range at the end.
|
inline |
Adds a member, moving it, at the end.