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

<<value-type>> Represents a UnionType member More...

#include "dds/core/xtypes/MemberType.hpp"

Public Types

typedef DDS_Long DiscriminatorType
 The type to represent a union discriminator.
 
typedef std::vector
< DiscriminatorType
LabelSeq
 A sequence of values for the discriminator that select a member.
 

Public Member Functions

 UnionMember (const std::string &name, const DynamicTypeImpl &type, const LabelSeq &labels)
 Creates a union member with a name, type and selected by one or more labels.
 
 UnionMember (const std::string &name, const DynamicTypeImpl &type, DiscriminatorType label)
 Creates a union member with a name, type and selected by a single label.
 
 UnionMember (const std::string &the_name, DynamicTypeImpl &&the_type, const LabelSeq &the_labels)
 <<C++11>> Creates a union member with a name, type and selected by one or more labels.
 
 UnionMember (const std::string &the_name, DynamicTypeImpl &&the_type, DiscriminatorType the_label)
 <<C++11>> Creates a union member with a name, type and selected by a single label.
 
const dds::core::stringname () const
 Gets the name.
 
dds::core::stringname ()
 Gets the member name.
 
uint32_t label_count () const
 Gets the number of labels that select this member.
 
LabelSeq labels () const
 Gets a copy of all the labels that select this member.
 
UnionMemberlabels (const LabelSeq &values)
 Sets the labels that select this member.
 
UnionMemberlabel (DiscriminatorType value)
 Sets a single label that selects this member.
 
UnionMembername (const dds::core::string &value)
 Sets the name.
 
UnionMemberid (int32_t value)
 Sets the ID annotation of a member.
 
UnionMemberpointer (bool value)
 <<extension>> Makes a member a pointer
 

Static Public Attributes

static
OMG_DDS_API_CLASS_VARIABLE
DiscriminatorType 
DEFAULT_LABEL
 Special value for the default: union label.
 

Detailed Description

<<value-type>> Represents a UnionType member

Encapsulates the name, type and labels of a UnionType member along with several IDL annotations such as id.

Member Typedef Documentation

typedef DDS_Long dds::core::xtypes::UnionMember::DiscriminatorType

The type to represent a union discriminator.

typedef std::vector<DiscriminatorType> dds::core::xtypes::UnionMember::LabelSeq

A sequence of values for the discriminator that select a member.

Constructor & Destructor Documentation

dds::core::xtypes::UnionMember::UnionMember ( const std::string &  name,
const DynamicTypeImpl &  type,
const LabelSeq labels 
)

Creates a union member with a name, type and selected by one or more labels.

dds::core::xtypes::UnionMember::UnionMember ( const std::string &  name,
const DynamicTypeImpl &  type,
DiscriminatorType  label 
)

Creates a union member with a name, type and selected by a single label.

dds::core::xtypes::UnionMember::UnionMember ( const std::string &  the_name,
DynamicTypeImpl &&  the_type,
const LabelSeq the_labels 
)
inline

<<C++11>> Creates a union member with a name, type and selected by one or more labels.

It moves the type.

dds::core::xtypes::UnionMember::UnionMember ( const std::string &  the_name,
DynamicTypeImpl &&  the_type,
DiscriminatorType  the_label 
)
inline

<<C++11>> Creates a union member with a name, type and selected by a single label.

It moves the type.

Member Function Documentation

const dds::core::string& dds::core::xtypes::UnionMember::name ( ) const

Gets the name.

dds::core::string& dds::core::xtypes::UnionMember::name ( )

Gets the member name.

uint32_t dds::core::xtypes::UnionMember::label_count ( ) const

Gets the number of labels that select this member.

LabelSeq dds::core::xtypes::UnionMember::labels ( ) const

Gets a copy of all the labels that select this member.

UnionMember& dds::core::xtypes::UnionMember::labels ( const LabelSeq values)

Sets the labels that select this member.

UnionMember& dds::core::xtypes::UnionMember::label ( DiscriminatorType  value)

Sets a single label that selects this member.

If more than one label selects this case, use labels(const LabelSeq&)

UnionMember& dds::core::xtypes::UnionMember::name ( const dds::core::string value)

Sets the name.

UnionMember& dds::core::xtypes::UnionMember::id ( int32_t  value)

Sets the ID annotation of a member.

[default] Automatically assigned as the ID of the previous member plus one previous member

UnionMember& dds::core::xtypes::UnionMember::pointer ( bool  value)

<<extension>> Makes a member a pointer

[default] false

Member Data Documentation

OMG_DDS_API_CLASS_VARIABLE DiscriminatorType dds::core::xtypes::UnionMember::DEFAULT_LABEL
static

Special value for the default: union label.


RTI Connext Modern C++ API Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc