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

<<value-type>> Represents and IDL enum type More...

#include <dds/core/xtypes/EnumType.hpp>

Inheritance diagram for dds::core::xtypes::EnumType:
dds::core::xtypes::AbstractConstructedType< EnunMember > dds::core::xtypes::DynamicType

Public Member Functions

 EnumType (const std::string &name)
 Creates an empty enum type.
 
template<typename Container >
 EnumType (const std::string &the_name, const Container &the_members)
 Creates a enum with the members in a container.
 
template<typename MemberIter >
 EnumType (const std::string &the_name, MemberIter begin, MemberIter end)
 Creates a enum with the members in an iterator range.
 
 EnumType (const std::string &the_name, std::initializer_list< EnumMemberImpl > the_members)
 Creates a enum with the members in an initializer_list.
 
MemberIndex find_member_by_ordinal (int32_t ordinal) const
 Gets the index of the member with this ordinal value.
 
EnumTypeadd_member (const EnumMemberImpl &member)
 Adds a member at the end.
 
template<typename Container >
EnumTypeadd_members (const Container &the_members)
 Adds all the members of a container at the end.
 
EnumTypeadd_members (std::initializer_list< EnumMemberImpl > the_members)
 Adds all the members of an initializer_list at the end.
 
template<typename MemberIter >
EnumTypeadd_members (MemberIter begin, MemberIter end)
 Adds all the members in an iterator range at the end.
 
- Public Member Functions inherited from dds::core::xtypes::AbstractConstructedType< EnunMember >
dds::core::xtypes::ExtensibilityKind extensibility_kind () const
 Gets the extensibility kind.
 
size_t member_count () const
 Gets the number of members.
 
const EnunMember & member (MemberIndex index) const
 Gets a member by its index.
 
const EnunMember & 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< EnunMember > 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.
 

Additional Inherited Members

- Public Types inherited from dds::core::xtypes::AbstractConstructedType< EnunMember >
typedef EnunMember 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< EnunMember >
static
OMG_DDS_API_CLASS_VARIABLE
const MemberIndex 
INVALID_INDEX
 Indicates that a member doesn't exist.
 

Detailed Description

<<value-type>> Represents and IDL enum type

Constructor & Destructor Documentation

dds::core::xtypes::EnumType::EnumType ( const std::string &  name)

Creates an empty enum type.

Members can be added after creation.

Parameters
nameThe name of the type
template<typename Container >
dds::core::xtypes::EnumType::EnumType ( const std::string &  the_name,
const Container &  the_members 
)
inline

Creates a enum with the members in a container.

Template Parameters
ContainerA container that provides the member functions begin() and end() to iterate over EnumMember elements.
Parameters
the_nameThe name of the type
the_membersA container with the members for this enum type
template<typename MemberIter >
dds::core::xtypes::EnumType::EnumType ( const std::string &  the_name,
MemberIter  begin,
MemberIter  end 
)
inline

Creates a enum with the members in an iterator range.

Template Parameters
MemberIterA forward iterator of EnumMember elements
Parameters
the_nameThe name of the type
beginThe beginning of the range of EnumMembers
endThe end of the range of EnumMembers
dds::core::xtypes::EnumType::EnumType ( const std::string &  the_name,
std::initializer_list< EnumMemberImpl >  the_members 
)
inline

Creates a enum with the members in an initializer_list.

Parameters
the_nameThe name of the type
the_membersAn ininitalizer_list of EnumMembers

Member Function Documentation

MemberIndex dds::core::xtypes::EnumType::find_member_by_ordinal ( int32_t  ordinal) const

Gets the index of the member with this ordinal value.

Returns
The index (which can be passed to member(uint32_t) of the member with this ordinal value or INVALID_INDEX if that ordinal doesn't exist
EnumType& dds::core::xtypes::EnumType::add_member ( const EnumMemberImpl &  member)

Adds a member at the end.

template<typename Container >
EnumType& dds::core::xtypes::EnumType::add_members ( const Container &  the_members)
inline

Adds all the members of a container at the end.

EnumType& dds::core::xtypes::EnumType::add_members ( std::initializer_list< EnumMemberImpl >  the_members)
inline

Adds all the members of an initializer_list at the end.

template<typename MemberIter >
EnumType& dds::core::xtypes::EnumType::add_members ( MemberIter  begin,
MemberIter  end 
)
inline

Adds all the members in an iterator range at the end.


RTI Connext Modern C++ API Version 5.3.0 Copyright © Sun Jun 25 2017 Real-Time Innovations, Inc