RTI Connext C# API  6.1.0
UnionMember Class Reference

Represents a union member in a UnionType. More...

Inheritance diagram for UnionMember:
IUnionMember IAggregationMember IMember

Public Member Functions

 UnionMember (string name, DynamicType type, IEnumerable< int > labels, int id=InvalidMemberId, bool isExternal=false)
 Creates a new UnionMember. More...
 
override bool Equals (object other)
 Compares for equality More...
 
override int GetHashCode ()
 Calculates a hash code More...
 
bool Equals (UnionMember other)
 Compares for equality More...
 
override string ToString ()
 Returns the member type and name More...
 

Static Public Attributes

const int InvalidMemberId
 The default value for a member id. More...
 
const int DefaultLabel
 A special integer used by Labels to indicate that a union member is selected by the default: label. More...
 

Properties

string Name [get]
 The member name. More...
 
DynamicType Type [get]
 The member type. More...
 
bool IsExternal [get]
 Whether this member is annotated as @external. More...
 
int Id [get]
 The member IDL (value of the @id annotation). More...
 
IEnumerable< int > Labels [get]
 The labels that select this union member. More...
 
- Properties inherited from IUnionMember
IEnumerable< int > Labels [get]
 The labels that select this IUnionMember. More...
 
- Properties inherited from IAggregationMember
IDynamicType Type [get]
 The IDynamicType of the IAggregationMember. More...
 
int Id [get]
 The id of the IAggregationMember. More...
 
bool IsExternal [get]
 Indicates whether or not the IAggregationMember is annotated as external. More...
 
- Properties inherited from IMember
string Name [get]
 The name of the member. More...
 

Detailed Description

Represents a union member in a UnionType.

Constructor & Destructor Documentation

◆ UnionMember()

UnionMember ( string  name,
DynamicType  type,
IEnumerable< int >  labels,
int  id = InvalidMemberId,
bool  isExternal = false 
)

Creates a new UnionMember.

Parameters
nameThe name (required)
typeThe type (required)
labelsThe labels that select this member (required)
idAn explicit member ID (optional, automatically assigned by default)
isExternalWhether to set @external (optional, false by default)

Member Function Documentation

◆ Equals() [1/2]

override bool Equals ( object  other)

Compares for equality

◆ Equals() [2/2]

bool Equals ( UnionMember  other)

Compares for equality

◆ GetHashCode()

override int GetHashCode ( )

Calculates a hash code

◆ ToString()

override string ToString ( )

Returns the member type and name

Member Data Documentation

◆ DefaultLabel

const int DefaultLabel
static

A special integer used by Labels to indicate that a union member is selected by the default: label.

◆ InvalidMemberId

const int InvalidMemberId
static

The default value for a member id.

Property Documentation

◆ Id

int Id
get

The member IDL (value of the @id annotation).

◆ IsExternal

bool IsExternal
get

Whether this member is annotated as @external.

◆ Labels

IEnumerable<int> Labels
get

The labels that select this union member.

When the union's discriminator is not of type int, the elements in this collection are cast to int.

The special value DefaultLabel refers to the default: label.

The full documentation is available in the C API: DDS_UnionMember::labels

◆ Name

string Name
get

The member name.

◆ Type

DynamicType Type
get

The member type.