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

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

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

Public Member Functions

 Member (const std::string &name, const DynamicTypeImpl &type)
 Creates a member consisting of a name and a type.
 
 Member (const std::string &the_name, DynamicTypeImpl &&the_type)
 <<C++11>> Creates a member consisting of a name and a type.
 
const dds::core::stringname () const
 Gets the member name.
 
dds::core::stringname ()
 Gets the member name.
 
const DynamicTypetype ()
 Gets the member type.
 
bool has_id () const
 Indicates it the member has an ID annotation.
 
int32_t get_id () const
 Returns the ID annotation of this member.
 
bool is_pointer () const
 <<extension>> Indicates if this member is a pointer
 
bool is_key () const
 Checks if a member is a key.
 
bool is_optional () const
 Checks if a member is optional.
 
bool is_bitset () const
 Checks if a member is a bitset.
 
bool has_bitbound () const
 Unsupported, always returns false.
 
int32_t get_bitbound () const
 Unsupported, always returns 32.
 
Membername (const dds::core::string &value)
 Sets the member name.
 
Memberkey (bool value)
 Sets the key annotation of a member.
 
Memberoptional (bool value)
 Sets the optional annotation of a member.
 
Memberid (int32_t value)
 Sets the ID annotation of a member.
 
Memberpointer (bool value)
 <<extension>> Makes a member a pointer
 

Static Public Attributes

static const int32_t INVALID_ID
 The special ID of a member without the ID annotation.
 

Detailed Description

<<value-type>> Represents a StructType member

Encapsulates the name and type of a StructType member along with several IDL annotations (key, optional, bitset, bitbound, id).

Constructor & Destructor Documentation

dds::core::xtypes::Member::Member ( const std::string &  name,
const DynamicTypeImpl &  type 
)

Creates a member consisting of a name and a type.

dds::core::xtypes::Member::Member ( const std::string &  the_name,
DynamicTypeImpl &&  the_type 
)
inline

<<C++11>> Creates a member consisting of a name and a type.

The type is moved.

Member Function Documentation

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

Gets the member name.

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

Gets the member name.

const DynamicType& dds::core::xtypes::Member::type ( )

Gets the member type.

bool dds::core::xtypes::Member::has_id ( ) const

Indicates it the member has an ID annotation.

True if this member has been annotated explicitly with an ID. False if the has a default-assigned ID.

int32_t dds::core::xtypes::Member::get_id ( ) const

Returns the ID annotation of this member.

If has_id() is true, this returns the value of the ID annotation. Otherwise it returns INVALID_ID.

bool dds::core::xtypes::Member::is_pointer ( ) const

<<extension>> Indicates if this member is a pointer

bool dds::core::xtypes::Member::is_key ( ) const

Checks if a member is a key.

This corresponds to the @Key IDL member annotation

bool dds::core::xtypes::Member::is_optional ( ) const

Checks if a member is optional.

This corresponds to the @Optional IDL member annotation

bool dds::core::xtypes::Member::is_bitset ( ) const

Checks if a member is a bitset.

bool dds::core::xtypes::Member::has_bitbound ( ) const

Unsupported, always returns false.

int32_t dds::core::xtypes::Member::get_bitbound ( ) const

Unsupported, always returns 32.

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

Sets the member name.

Member& dds::core::xtypes::Member::key ( bool  value)

Sets the key annotation of a member.

Postcondition
If optional() was true and key is set to true, optional() becomes false, because a member can't be both a key and optional.

[default] false

Member& dds::core::xtypes::Member::optional ( bool  value)

Sets the optional annotation of a member.

Postcondition
If key() was true and optional is set to true, key() becomes false, because a member can't be both a key and optional.

[default] false

Member& dds::core::xtypes::Member::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

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

<<extension>> Makes a member a pointer

[default] false

Member Data Documentation

const int32_t dds::core::xtypes::Member::INVALID_ID
static

The special ID of a member without the ID annotation.


RTI Connext Modern C++ API Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc