TypeCode Class Reference
[Type Code Support]

The definition of a particular data type, which you can use to inspect the name, members, and other properties of types generated with rtiddsgen or to modify types you define yourself at runtime. More...

Inherits java.io.Serializable.

List of all members.

Public Member Functions

TCKind kind ()
 Gets the TCKind value of a type code.
boolean equal (TypeCode tc)
 Compares two TypeCode objects for equality.
boolean equals (Object tc)
 Compares two TypeCode objects for equality.
int length () throws BadKind
 Returns the number of elements in the type described by this type code.
String name () throws BadKind
 Retrieves the simple name identifying this TypeCode object within its enclosing scope.
boolean is_alias_pointer () throws BadKind
 Function that tells if an alias is a pointer or not.
short type_modifier () throws BadKind
 Returns a constant indicating the modifier of the value type that this TypeCode object describes.
TypeCode concrete_base_type () throws BadKind
 Returns the TypeCode that describes the concrete base type of the value type that this TypeCode object describes.
TypeCode content_type () throws BadKind
 Returns the TypeCode object representing the type for the members of the object described by this TypeCode object.
int array_dimension_count () throws BadKind
 This function returns the number of dimensions of an array type code.
int array_dimension (int index) throws BadKind,Bounds
 This function returns the index-th dimension of an array type code.
int element_count () throws BadKind
 The number of elements in an array.
int member_count () throws BadKind
 Returns the number of members of the type code.
String member_name (int index) throws BadKind,Bounds
 Returns the name of a type code member identified by the given index.
TypeCode member_type (int index) throws BadKind,Bounds
 Retrieves the TypeCode object describing the type of the member identified by the given index.
int member_id (int index) throws BadKind,Bounds
 Returns the ID of a sparse type code member identified by the given index.
int member_label_count (int index) throws BadKind,Bounds
 Returns the number of labels associated to the index-th union member.
int member_label (int member_index, int label_index) throws BadKind,Bounds
 Return the label_index-th label associated to the member_index-th member.
int member_ordinal (int index) throws BadKind,Bounds
 Returns the ordinal that corresponds to the index-th enum value.
boolean is_member_key (int index) throws BadKind,Bounds
 Function that tells if a member is a key or not.
boolean is_member_required (int index) throws BadKind,Bounds
 Indicates whether a given member of a type is required to be present in every sample of that type.
boolean is_member_pointer (int index) throws BadKind,Bounds
 Function that tells if a member is a pointer or not.
boolean is_member_bitfield (int index) throws BadKind,Bounds
 Function that tells if a member is a bitfield or not.
short member_bitfield_bits (int index) throws BadKind,Bounds
 Returns the number of bits of a bitfield member.
short member_visibility (int index) throws BadKind,Bounds
 Returns the constant that indicates the visibility of the index-th member.
TypeCode discriminator_type () throws BadKind
 Returns the discriminator type code.
int default_index () throws BadKind
 Returns the index of the default member, or -1 if there is no default member.
int find_member_by_id (int id) throws BadKind
 Get the index of the member of the given ID.
int find_member_by_name (String name) throws BadKind
 Get the index of the member of the given name.
void print_IDL (int indent)
 Prints a TypeCode in a pseudo-IDL notation.
int add_member (String name, int id, TypeCode tc, byte member_flags) throws BadKind,BadMemberName,BadMemberId
 Add a new member to this TypeCode.
int add_member (String name, int id, TypeCode tc, byte member_flags, short visibility, boolean is_pointer, short bits) throws BadKind,BadMemberName,BadMemberId,BAD_PARAM
 Add a new member to this TypeCode.
int add_member_to_enum (String name, int ordinal) throws BadKind,BadMemberName
 Add a new enumerated constant to this enum TypeCode.

Static Public Attributes

static final TypeCode TC_NULL
 Basic null type.
static final TypeCode TC_SHORT
 Basic 16-bit signed integer type.
static final TypeCode TC_LONG
 Basic 32-bit signed integer type.
static final TypeCode TC_USHORT
 Basic unsigned 16-bit integer type.
static final TypeCode TC_ULONG
 Basic unsigned 32-bit integer type.
static final TypeCode TC_FLOAT
 Basic 32-bit floating point type.
static final TypeCode TC_DOUBLE
 Basic 64-bit floating point type.
static final TypeCode TC_BOOLEAN
 Basic Boolean type.
static final TypeCode TC_CHAR
 Basic single-byte character type.
static final TypeCode TC_OCTET
 Basic octet/byte type.
static final TypeCode TC_LONGLONG
 Basic 64-bit integer type.
static final TypeCode TC_ULONGLONG
 Basic unsigned 64-bit integer type.
static final TypeCode TC_LONGDOUBLE
 Basic 128-bit floating point type.
static final TypeCode TC_WCHAR
 Basic four-byte character type.
static final int MEMBER_ID_INVALID
 A sentinel indicating an invalid TypeCode member ID.
static final int INDEX_INVALID
 A sentinel indicating an invalid TypeCode member index.
static final byte NONKEY_MEMBER
 A flag indicating that a type member is optional and not part of the key.
static final byte KEY_MEMBER
 A flag indicating that a type member is part of the key for that type, and therefore required.
static final byte NONKEY_REQUIRED_MEMBER
 A flag indicating that a type member is not part of the key but is nevertheless required.
static final short NOT_BITFIELD
 Indicates that a member of a type is not a bitfield.


Detailed Description

The definition of a particular data type, which you can use to inspect the name, members, and other properties of types generated with rtiddsgen or to modify types you define yourself at runtime.

You create TypeCode objects using the TypeCodeFactory singleton. Then you can use the methods on this class to inspect and modify the data type definition.

This class is based on a similar class from CORBA.

MT Safety:
SAFE for read-only access, UNSAFE for modification. Modifying a single TypeCode object concurrently from multiple threads is unsafe. Modifying a TypeCode from a single thread while concurrently reading the state of that TypeCode from another thread is also unsafe. However, reading the state of a TypeCode concurrently from multiple threads, without any modification, is safe.
See also:
http://java.sun.com/javase/6/docs/api/org/omg/CORBA/TypeCode.html

Member Function Documentation

TCKind kind (  ) 

Gets the TCKind value of a type code.

Retrieves the kind of this TypeCode object. The kind of a type code determines which TypeCode methods may legally be invoked on it.

MT Safety:
SAFE.
Returns:
The type code kind.

boolean equal ( TypeCode  tc  ) 

Compares two TypeCode objects for equality.

MT Safety:
SAFE.
Parameters:
tc <<in>> Type code that will be compared with this TypeCode.
Exceptions:
com.rti.dds.infrastructure.BAD_PARAM if tc is null.
Returns:
true if the type codes are equal. Otherwise, false.
See also:
http://java.sun.com/javase/6/docs/api/org/omg/CORBA/TypeCode.html#equal(org.omg.CORBA.TypeCode)

boolean equals ( Object  tc  ) 

Compares two TypeCode objects for equality.

MT Safety:
SAFE.
Parameters:
tc <<in>> Type code that will be compared with this TypeCode.
Returns:
true if the type codes are equal. Otherwise, false.
See also:
http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)

int length (  )  throws BadKind

Returns the number of elements in the type described by this type code.

Length is:

  • The maximum length of the string for string type codes.
  • The maximum length of the sequence for sequence type codes.
  • The first dimension of the array for array type codes.
Precondition:
self kind is TCKind.TK_ARRAY, TCKind.TK_SEQUENCE, TCKind.TK_STRING or TCKind.TK_WSTRING.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
The bound for strings and sequences, or the number of elements for arrays if no errors.

String name (  )  throws BadKind

Retrieves the simple name identifying this TypeCode object within its enclosing scope.

Precondition:
self kind is TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_ENUM, TCKind.TK_VALUE, TCKind.TK_SPARSE or TCKind.TK_ALIAS.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
Name of the type code if no errors.

boolean is_alias_pointer (  )  throws BadKind

Function that tells if an alias is a pointer or not.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_ALIAS.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
true if an alias is a pointer to the aliased type. Otherwise, false.

short type_modifier (  )  throws BadKind

Returns a constant indicating the modifier of the value type that this TypeCode object describes.

Precondition:
self kind is TCKind.TK_VALUE.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
One of the following type modifiers: VM_NONE, VM_ABSTRACT, VM_CUSTOM or VM_TRUNCATABLE.

TypeCode concrete_base_type (  )  throws BadKind

Returns the TypeCode that describes the concrete base type of the value type that this TypeCode object describes.

Precondition:
self kind is TCKind.TK_VALUE or TCKind.TK_SPARSE.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
TypeCode that describes the concrete base type or null if there is no a concrete base type.

TypeCode content_type (  )  throws BadKind

Returns the TypeCode object representing the type for the members of the object described by this TypeCode object.

For sequences and arrays, it returns the element type. For aliases, it returns the original type.

Precondition:
self kind is TCKind.TK_ARRAY, TCKind.TK_SEQUENCE or TCKind.TK_ALIAS.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
A TypeCode object representing the element type for sequences and arrays, and the original type for aliases.

int array_dimension_count (  )  throws BadKind

This function returns the number of dimensions of an array type code.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_ARRAY.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
Number of dimensions if no errors.

int array_dimension ( int  index  )  throws BadKind,Bounds

This function returns the index-th dimension of an array type code.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_ARRAY.
Dimension index in the interval [0,(dimensions count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Dimension index in the interval [0,(dimensions count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
Requested dimension if no errors.

int element_count (  )  throws BadKind

The number of elements in an array.

This operation isn't relevant for other kinds of types.

MT Safety:
SAFE.

int member_count (  )  throws BadKind

Returns the number of members of the type code.

The method member_count can be invoked on structure, union, and enumeration TypeCode objects.

Precondition:
self kind is TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_ENUM, TCKind.TK_VALUE or TCKind.TK_SPARSE.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
The number of members constituting the type described by this TypeCode object if no errors.

String member_name ( int  index  )  throws BadKind,Bounds

Returns the name of a type code member identified by the given index.

The method member_name can be invoked on structure, union, and enumeration TypeCode objects.

Precondition:
self kind is TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_ENUM, TCKind.TK_VALUE or TCKind.TK_SPARSE.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
Name of the member if no errors.

TypeCode member_type ( int  index  )  throws BadKind,Bounds

Retrieves the TypeCode object describing the type of the member identified by the given index.

The method member_type can be invoked on structure and union type codes.

Precondition:
self kind is TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_VALUE or TCKind.TK_SPARSE.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
The TypeCode object describing the member at the given index if no errors.

int member_id ( int  index  )  throws BadKind,Bounds

Returns the ID of a sparse type code member identified by the given index.

The method can be invoked on sparse TypeCode objects.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_SPARSE.
Member index in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
ID of the member if no errors.

int member_label_count ( int  index  )  throws BadKind,Bounds

Returns the number of labels associated to the index-th union member.

The method can be invoked on union TypeCode objects.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_UNION.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
Number of labels if no errors.

int member_label ( int  member_index,
int  label_index 
) throws BadKind,Bounds

Return the label_index-th label associated to the member_index-th member.

This method has been modified for RTI Connext from the CORBA Type code Specification.

Example:
  case 1: Label index 0
  case 2: Label index 1
    short short_member;

The method can be invoked on union TypeCode objects.

Precondition:
self kind is TCKind.TK_UNION.
The member_index param must be in the interval [0,(member count-1)].
The label_index param must be in the interval [0,(member labels count-1)].
MT Safety:
SAFE.
Parameters:
member_index <<in>> Member index.
label_index <<in>> Label index.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
The evaluated value of the label if no errors.

int member_ordinal ( int  index  )  throws BadKind,Bounds

Returns the ordinal that corresponds to the index-th enum value.

The method can be invoked on enum TypeCode objects.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_ENUM.
Member index in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
Ordinal that corresponds to the index-th enumerator if no errors.

boolean is_member_key ( int  index  )  throws BadKind,Bounds

Function that tells if a member is a key or not.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_STRUCT, TCKind.TK_VALUE or TCKind.TK_SPARSE.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
true if the member is a key. Otherwise, false.

boolean is_member_required ( int  index  )  throws BadKind,Bounds

Indicates whether a given member of a type is required to be present in every sample of that type.

Which fields are required depends on the TCKind of the type. For example, in a type of kind TCKind.TK_SPARSE, key fields are required. In TCKind.TK_STRUCT and TCKind.TK_VALUE types, all fields are required.

MT Safety:
SAFE.

boolean is_member_pointer ( int  index  )  throws BadKind,Bounds

Function that tells if a member is a pointer or not.

The method is_member_pointer can be invoked on union and structs type objects

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_STRUCT, TCKind.TK_UNION or TCKind.TK_VALUE.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Index of the member for which type information is begin requested.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
true if the member is a pointer. Otherwise, false.

boolean is_member_bitfield ( int  index  )  throws BadKind,Bounds

Function that tells if a member is a bitfield or not.

The method can be invoked on struct type objects.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_STRUCT or TCKind.TK_VALUE.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
true if the member is a bitfield. Otherwise, false.

short member_bitfield_bits ( int  index  )  throws BadKind,Bounds

Returns the number of bits of a bitfield member.

The method can be invoked on struct type objects.

This function is an RTI Connext extension to the CORBA Type Code Specification.

Precondition:
self kind is TCKind.TK_STRUCT or TCKind.TK_VALUE.
The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
The number of bits of the bitfield or TypeCode.NOT_BITFIELD if the member is not a bitfield.

short member_visibility ( int  index  )  throws BadKind,Bounds

Returns the constant that indicates the visibility of the index-th member.

Precondition:
self kind is TCKind.TK_VALUE. The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.
Parameters:
index <<in>> Member index in the interval [0,(member count-1)].
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.Bounds - if the index parameter/s are out of range.
Returns:
One of the following constants: PRIVATE_MEMBER or PUBLIC_MEMBER.

TypeCode discriminator_type (  )  throws BadKind

Returns the discriminator type code.

The method discriminator_type can be invoked only on union TypeCode objects.

Precondition:
self kind is TCKind.TK_UNION.
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
TypeCode object describing the discriminator of the union type if no errors.

int default_index (  )  throws BadKind

Returns the index of the default member, or -1 if there is no default member.

The method default_index can be invoked only on union TypeCode objects.

Precondition:
self kind is TCKind.TK_UNION
MT Safety:
SAFE.
Exceptions:
com.rti.dds.infrastructure.BadKind if the method is invoked on an inappropriate kind of TypeCode object.
Returns:
The index of the default member, or -1 if there is no default member.

int find_member_by_id ( int  id  )  throws BadKind

Get the index of the member of the given ID.

MT Safety:
SAFE.

int find_member_by_name ( String  name  )  throws BadKind

Get the index of the member of the given name.

MT Safety:
SAFE.

void print_IDL ( int  indent  ) 

Prints a TypeCode in a pseudo-IDL notation.

MT Safety:
SAFE.
Parameters:
indent <<in>> Indent.

int add_member ( String  name,
int  id,
TypeCode  tc,
byte  member_flags 
) throws BadKind,BadMemberName,BadMemberId

Add a new member to this TypeCode.

This method is applicable to TypeCode objects representing structures (TCKind.TK_STRUCT), value types (TCKind.TK_VALUE), sparse value types (TCKind.TK_SPARSE), and unions (TCKind.TK_UNION). To add a constant to an enumeration, see TypeCode.add_member_to_enum.

Modifying a TypeCode -- such as by adding a member -- is important if you are using the Dynamic Data APIs.

Here's a simple code example that adds two fields to a data type, one an integer and another a sequence of integers.

 // Integer: 
  myTypeCode.add_member( 
      "myFieldName", 
      // If the type is sparse, specify an ID. Otherwise, use this sentinel: 
      TypeCode.MEMBER_ID_INVALID, 
      TypeCode.TC_LONG, 
      // New field is not a key: 
      TypeCode.NONKEY_REQUIRED_MEMBER); 
  
  // Sequence of 10 or fewer integers: 
  myTypeCode.add_member( 
      "myFieldName", 
      // If the type is sparse, specify an ID. Otherwise, use this sentinel: 
      TypeCode.MEMBER_ID_INVALID, 
      TypeCodeFactory.get_instance().create_sequence_tc(10, TypeCode.TC_LONG), 
      // New field is not a key: 
      TypeCode.NONKEY_REQUIRED_MEMBER); 

MT Safety:
UNSAFE.
Parameters:
name <<in>> The name of the new member.
id <<in>> The ID of the new member. This should only be specified for members of kind TCKind.TK_SPARSE and TCKind.TK_UNION; otherwise, it should be TypeCode.MEMBER_ID_INVALID.
tc <<in>> The type of the new member. You can get or create this TypeCode with the TypeCodeFactory.
member_flags <<in>> Indicates whether the member is part of the key and whether it is required.
Returns:
The zero-based index of the new member relative to any other members that previously existed.
See also:
TypeCode.add_member

TypeCode.add_member_to_enum

TypeCodeFactory

TypeCode.NONKEY_MEMBER

TypeCode.KEY_MEMBER

TypeCode.NONKEY_REQUIRED_MEMBER

int add_member ( String  name,
int  id,
TypeCode  tc,
byte  member_flags,
short  visibility,
boolean  is_pointer,
short  bits 
) throws BadKind,BadMemberName,BadMemberId,BAD_PARAM

Add a new member to this TypeCode.

Modifying a TypeCode -- such as by adding a member -- is important if you are using the Dynamic Data APIs.

MT Safety:
UNSAFE.
Parameters:
name <<in>> The name of the new member.
id <<in>> The ID of the new member. This should only be specified for members of kind TCKind.TK_SPARSE and TCKind.TK_UNION; otherwise, it should be TypeCode.MEMBER_ID_INVALID.
tc <<in>> The type of the new member. You can get or create this TypeCode with the TypeCodeFactory.
member_flags <<in>> Indicates whether the member is part of the key and whether it is required.
visibility <<in>> Whether the new member is public or private. Non-public members are only relevant for types of kind TCKind.TK_VALUE and TCKind.TK_SPARSE.
is_pointer <<in>> Whether the data member, in its deserialized form, should be stored by pointer as opposed to by value.
bits <<in>> The number of bits, if this new member is a bit field, or TypeCode.NOT_BITFIELD.
Returns:
The zero-based index of the new member relative to any other members that previously existed.
See also:
TypeCode.add_member

TypeCodeFactory

TypeCode.NONKEY_MEMBER

TypeCode.KEY_MEMBER

TypeCode.NONKEY_REQUIRED_MEMBER

int add_member_to_enum ( String  name,
int  ordinal 
) throws BadKind,BadMemberName

Add a new enumerated constant to this enum TypeCode.

This method is applicable to TypeCode objects representing enumerations (TCKind.TK_ENUM). To add a field to a structured type, see TypeCode.add_member_to_enum.

Modifying a TypeCode -- such as by adding a member -- is important if you are using the Dynamic Data APIs.

MT Safety:
UNSAFE.
Parameters:
name <<in>> The name of the new member. This string must be unique within this type and must not be null.
ordinal <<in>> The relative order of the new member in this enum or a custom integer value. The value must be unique within the type.
Returns:
The zero-based index of the new member relative to any other members that previously existed.
See also:
TypeCode.add_member

TypeCode.add_member

TypeCodeFactory


Member Data Documentation

final TypeCode TC_NULL [static]

Basic null type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_SHORT [static]

Basic 16-bit signed integer type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_LONG [static]

Basic 32-bit signed integer type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_USHORT [static]

Basic unsigned 16-bit integer type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_ULONG [static]

Basic unsigned 32-bit integer type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_FLOAT [static]

Basic 32-bit floating point type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_DOUBLE [static]

Basic 64-bit floating point type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_BOOLEAN [static]

Basic Boolean type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_CHAR [static]

Basic single-byte character type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_OCTET [static]

Basic octet/byte type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_LONGLONG [static]

Basic 64-bit integer type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_ULONGLONG [static]

Basic unsigned 64-bit integer type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_LONGDOUBLE [static]

Basic 128-bit floating point type.

See also:
TypeCodeFactory.get_primitive_tc

final TypeCode TC_WCHAR [static]

Basic four-byte character type.

See also:
TypeCodeFactory.get_primitive_tc

final int MEMBER_ID_INVALID [static]

A sentinel indicating an invalid TypeCode member ID.

final int INDEX_INVALID [static]

A sentinel indicating an invalid TypeCode member index.

final byte NONKEY_MEMBER [static]

A flag indicating that a type member is optional and not part of the key.

Only sparse value types (i.e. types of TCKind TCKind.TK_SPARSE) support this flag. Non-key members of other type kinds should use the flag TypeCode.NONKEY_REQUIRED_MEMBER.

If a type is used with the Dynamic Data facility, a com.rti.dds.dynamicdata.DynamicData sample of the type will only contain a value for a TypeCode.NONKEY_MEMBER field if one has been explicitly set (see, for example, DynamicData.set_int). The middleware will not assume any default value.

See also:
TypeCode.KEY_MEMBER

TypeCode.NONKEY_REQUIRED_MEMBER

TypeCode.KEY_MEMBER

TypeCode.add_member

TypeCode.add_member

TypeCode.is_member_key

TypeCode.is_member_required

StructMember.is_key

ValueMember.is_key

final byte KEY_MEMBER [static]

A flag indicating that a type member is part of the key for that type, and therefore required.

If a type is used with the Dynamic Data facility, all com.rti.dds.dynamicdata.DynamicData samples of the type will contain a value for all TypeCode.KEY_MEMBER fields, even if the type is a sparse value type (i.e. of kind TCKind.TK_SPARSE). If you do not set a value of the member explicitly (see, for example, DynamicData.set_int), the middleware will assume a default "zero" value: numeric values will be set to zero; strings and sequences will be of zero length.

See also:
TypeCode.NONKEY_REQUIRED_MEMBER

TypeCode.NONKEY_MEMBER

TypeCode.add_member

TypeCode.add_member

TypeCode.is_member_key

TypeCode.is_member_required

StructMember.is_key

ValueMember.is_key

final byte NONKEY_REQUIRED_MEMBER [static]

A flag indicating that a type member is not part of the key but is nevertheless required.

This is the most common kind of member.

If a type is used with the Dynamic Data facility, all com.rti.dds.dynamicdata.DynamicData samples of the type will contain a value for all TypeCode.NONKEY_REQUIRED_MEMBER fields, even if the type is a sparse value type (i.e. of kind TCKind.TK_SPARSE). If you do not set a value of the member explicitly (see, for example, DynamicData.set_int), the middleware will assume a default "zero" value: numeric values will be set to zero; strings and sequences will be of zero length.

See also:
TypeCode.KEY_MEMBER

TypeCode.NONKEY_MEMBER

TypeCode.KEY_MEMBER

TypeCode.add_member

TypeCode.add_member

TypeCode.is_member_key

TypeCode.is_member_required

StructMember.is_key

ValueMember.is_key

final short NOT_BITFIELD [static]

Indicates that a member of a type is not a bitfield.


RTI Connext Java API Version 4.5f Copyright © 17 Mar 2012 Real-Time Innovations, Inc