RTI Connext Java API  Version 6.1.1

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 Serializable.

Public Member Functions

TCKind kind ()
 Gets the com.rti.dds.typecode.TCKind value of a type code. More...
 
ExtensibilityKind extensibility_kind ()
 Gets the com.rti.dds.typecode.ExtensibilityKind value of a type code. More...
 
boolean equal (TypeCode tc)
 Compares two com.rti.dds.typecode.TypeCode objects for equality. More...
 
boolean equals (Object tc)
 Compares two com.rti.dds.typecode.TypeCode objects for equality. More...
 
boolean assignable (TypeCode from)
 Checks if this com.rti.dds.typecode.TypeCode is assignable from the input com.rti.dds.typecode.TypeCode. More...
 
int length () throws BadKind
 Returns the number of elements in the type described by this type code. More...
 
String name () throws BadKind
 Retrieves the simple name identifying this com.rti.dds.typecode.TypeCode object within its enclosing scope. More...
 
boolean is_alias_pointer () throws BadKind
 Function that tells if an alias is a pointer or not. More...
 
short type_modifier () throws BadKind
 Returns a constant indicating the modifier of the value type that this com.rti.dds.typecode.TypeCode object describes. More...
 
TypeCode concrete_base_type () throws BadKind
 Returns the com.rti.dds.typecode.TypeCode that describes the concrete base type of the value type that this com.rti.dds.typecode.TypeCode object describes. More...
 
TypeCode content_type () throws BadKind
 Returns the com.rti.dds.typecode.TypeCode object representing the type for the members of the object described by this com.rti.dds.typecode.TypeCode object. More...
 
int array_dimension_count () throws BadKind
 This function returns the number of dimensions of an array type code. More...
 
int array_dimension (int index) throws BadKind,Bounds
 This function returns the index-th dimension of an array type code. More...
 
int element_count () throws BadKind
 The number of elements in an array. More...
 
int member_count () throws BadKind
 Returns the number of members of the type code. More...
 
String member_name (int index) throws BadKind,Bounds
 Returns the name of a type code member identified by the given index. More...
 
TypeCode member_type (int index) throws BadKind,Bounds
 Retrieves the com.rti.dds.typecode.TypeCode object describing the type of the member identified by the given index. More...
 
int member_id (int index) throws BadKind,Bounds
 Returns the ID of the TypeCode member identified by the given index. More...
 
int member_label_count (int index) throws BadKind,Bounds
 Returns the number of labels associated to the index-th union member. More...
 
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. More...
 
int member_ordinal (int index) throws BadKind,Bounds
 Returns the ordinal that corresponds to the index-th enum value. More...
 
boolean is_member_key (int index) throws BadKind,Bounds
 Function that tells if a member is a key or not. More...
 
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. More...
 
boolean is_member_pointer (int index) throws BadKind,Bounds
 Function that tells if a member is a pointer or not. More...
 
boolean is_member_bitfield (int index) throws BadKind,Bounds
 Function that tells if a member is a bitfield or not. More...
 
short member_bitfield_bits (int index) throws BadKind,Bounds
 Returns the number of bits of a bitfield member. More...
 
short member_visibility (int index) throws BadKind,Bounds
 Returns the constant that indicates the visibility of the index-th member. More...
 
TypeCode discriminator_type () throws BadKind
 Returns the discriminator type code. More...
 
int default_index () throws BadKind
 Returns the index of the default member, or -1 if there is no default member. More...
 
int find_member_by_id (int id) throws BadKind
 Get the index of the member of the given ID. More...
 
int find_member_by_name (String name) throws BadKind
 Get the index of the member of the given name. More...
 
void print_IDL (int indent)
 Prints a com.rti.dds.typecode.TypeCode in IDL notation. More...
 
void print_IDL (int indent, Writer out) throws IOException
 Prints a com.rti.dds.typecode.TypeCode in a pseudo-IDL notation. More...
 
void print_complete_IDL (Writer writer) throws IOException
 
int add_member (String name, int id, TypeCode tc, byte member_flags) throws BadKind,BadMemberName,BadMemberId
 Add a new member to this com.rti.dds.typecode.TypeCode. More...
 
synchronized 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,IllegalStateException
 Add a new member to this com.rti.dds.typecode.TypeCode. More...
 
synchronized int add_member_to_enum (String name, int ordinal) throws BadKind,BadMemberName
 Add a new enumerated constant to this enum com.rti.dds.typecode.TypeCode. More...
 
synchronized int add_member_to_union (String name, int id, int labels_in[], TypeCode tc, boolean is_pointer) throws BadKind,BadMemberName, BadMemberId
 Add a new member to a union com.rti.dds.typecode.TypeCode. More...
 
String signature () throws RETCODE_ERROR
 Gets an MD5 signature of the com.rti.dds.typecode.TypeCode. More...
 
final long cdr_serialized_sample_min_size (short representation_id) throws UserException, SystemException
 Gets the minimum serialized size of samples of this type. More...
 
final long cdr_serialized_sample_min_size () throws UserException, SystemException
 Gets the minimum serialized size of samples of this type. More...
 
final long cdr_serialized_sample_max_size (short representation_id) throws UserException, SystemException
 Gets the maximum serialized size of samples of this type. More...
 
final long cdr_serialized_sample_max_size () throws UserException, SystemException
 Gets the maximum serialized size of samples of this type. More...
 
final long cdr_serialized_sample_key_max_size (short representation_id) throws UserException, SystemException
 Gets the maximum serialized size of sample keys of this type. More...
 
final long cdr_serialized_sample_key_max_size () throws UserException, SystemException
 Gets the maximum serialized size of sample keys of this type. More...
 
long get_type_object_serialized_size ()
 Gets the serialized size of the TypeObject created from this com.rti.dds.typecode.TypeCode. More...
 

Static Public Attributes

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

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 com.rti.dds.typecode.TypeCode objects using the com.rti.dds.typecode.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 com.rti.dds.typecode.TypeCode object concurrently from multiple threads is unsafe. Modifying a com.rti.dds.typecode.TypeCode from a single thread while concurrently reading the state of that com.rti.dds.typecode.TypeCode from another thread is also unsafe. However, reading the state of a com.rti.dds.typecode.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

◆ kind()

TCKind kind ( )

◆ extensibility_kind()

ExtensibilityKind extensibility_kind ( )

Gets the com.rti.dds.typecode.ExtensibilityKind value of a type code.

Retrieves the extensibility kind of this com.rti.dds.typecode.TypeCode object.

In some cases, it is desirable for types to evolve without breaking interoperability with deployed components already using those types. For example:

  • A new set of applications to be integrated into an existing system may want to introduce additional fields into a structure. These new fields can be safely ignored by already deployed applications, but applications that do understand the new fields can benefit from their presence.

  • A new set of applications to be integrated into an existing system may want to increase the maximum size of some sequence or string in a Type. Existing applications can receive data samples from these new applications as long as the actual number of elements (or length of the strings) in the received data sample does not exceed what the receiving applications expects. If a received data sample exceeds the limits expected by the receiving application, then the sample can be safely ignored (filtered out) by the receiver.

In order to support use cases such as these, the type system introduces the concept of extensible and mutable types.

  • A type may be final, indicating that the range of its possible data values is strictly defined. In particular, it is not possible to add elements to members of collection or aggregated types while maintaining type assignability.

  • A type may be extensible, indicating that two types, where one contains all of the elements/members of the other plus additional elements/members appended to the end, may remain assignable.

  • A type may be mutable, indicating that two types may differ from one another in the additional, removal, and/or transposition of elements/members while remaining assignable.

The extensibility of com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_UNION, com.rti.dds.typecode.TCKind.TK_VALUE, and com.rti.dds.typecode.TCKind.TK_ENUM can be change using the built-in "Extensibility" annotation when the type is declared.

IDL examples:

struct MyType {
long member_1;
} //@Extensibility FINAL_EXTENSIBILITY
struct MyType {
long member_1;
} //@Extensibility EXTENSIBLE_EXTENSIBILITY
struct MyType {
long member_1;
} //@Extensibility MUTABLE_EXTENSIBILITY

XML example:

<struct name="MyType" extensibility="final">
<member name="member_1" type="long"/>
</struct>
<struct name="MyType" extensibility="extensible">
<member name="member_1" type="long"/>
</struct>
<struct name="MyType" extensibility="mutable">
<member name="member_1" type="long"/>
</struct>

XSD example:

<xsd:complexType name="MyType">
<xsd:sequence>
<xsd:element name="member_1" minOccurs="1" maxOccurs="1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<!-- @struct true -->
<!-- @extensibility FINAL_EXTENSIBILITY -->
<xsd:complexType name="MyType">
<xsd:sequence>
<xsd:element name="member_1" minOccurs="1" maxOccurs="1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<!-- @struct true -->
<!-- @extensibility EXTENSIBLE_EXTENSIBILITY -->
<xsd:complexType name="MyType">
<xsd:sequence>
<xsd:element name="member_1" minOccurs="1" maxOccurs="1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<!-- @struct true -->
<!-- @extensibility MUTABLE_EXTENSIBILITY -->

For TypeCodes built at run-time using the com.rti.dds.typecode.TypeCodeFactory API, the extensibility can be provided as a parameter of the following APIs:

See also
com.rti.dds.typecode.ExtensibilityKind
MT Safety:
SAFE.
Returns
The type code extensibility kind.

Referenced by TypeCode.equal(), and TypeCode.find_member_by_name().

◆ equal()

boolean equal ( TypeCode  tc)

Compares two com.rti.dds.typecode.TypeCode objects for equality.

MT Safety:
SAFE.

For equality and assignability purposes, com.rti.dds.typecode.TCKind.TK_STRUCT and com.rti.dds.typecode.TCKind.TK_VALUE are considered equivalent.

The com.rti.dds.typecode.TypeCode of structs inheriting from other structs has a com.rti.dds.typecode.TCKind.TK_VALUE kind.

For example:

struct MyStruct: MyBaseStruct {
long member_1;
};

The code generation for the previous type will generate a com.rti.dds.typecode.TypeCode with com.rti.dds.typecode.TCKind.TK_VALUE kind.

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

References TypeCode.array_dimension(), TypeCode.array_dimension_count(), TypeCode.concrete_base_type(), TypeCode.content_type(), TypeCode.default_index(), TypeCode.discriminator_type(), TypeCode.equal(), TypeCode.equals(), TypeCode.extensibility_kind(), TypeCode.is_alias_pointer(), TypeCode.is_member_bitfield(), TypeCode.is_member_key(), TypeCode.is_member_pointer(), TypeCode.is_member_required(), TypeCode.kind(), TypeCode.length(), TypeCode.member_bitfield_bits(), TypeCode.member_count(), TypeCode.member_id(), TypeCode.member_label(), TypeCode.member_label_count(), TypeCode.member_name(), TypeCode.member_ordinal(), TypeCode.member_type(), TypeCode.member_visibility(), TypeCode.name(), TCKind.TK_ALIAS, TCKind.TK_ARRAY, TCKind.TK_ENUM, TCKind.TK_SEQUENCE, TCKind.TK_STRING, TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_VALUE, TCKind.TK_WSTRING, and TypeCode.type_modifier().

Referenced by TypeCode.equal(), TypeCode.equals(), and UnionMember.UnionMember().

◆ equals()

boolean equals ( Object  tc)

Compares two com.rti.dds.typecode.TypeCode objects for equality.

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

References TypeCode.equal().

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ assignable()

boolean assignable ( TypeCode  from)

Checks if this com.rti.dds.typecode.TypeCode is assignable from the input com.rti.dds.typecode.TypeCode.

MT Safety:
SAFE.

This method checks if this type code is assignable from the type code provided as a parameter.

In order to maintain the loose coupling between data producers and consumers, especially as systems change over time, it is desirable that the two be permitted to use slightly different versions of a type, and that the infrastructure perform any necessary translation. To support type evolution and inheritance the type system defines the "is-assignable-from" directed binary relationship between every pair of types in the Type System.

Intuitively, if T1 is-assignable-from T2, it means that in general it is possible, in a structural way, to set the contents of an object of type T1 to the contents of an object of T2 (or perhaps a subset of those contents) without leading to incorrect interpretations of that information.

For example:

struct MyBaseType {
long member_1;
};
struct MyDerivedType: MyBaseType {
long member_2;
};

The previous two types that are related to each other by an inheritance relationship are assignable.

For additional information on type assignability refer to the OMG Extensible and Dynamic Topic Types for DDS Specification.

Parameters
from<<in>> From type code
Returns
com.rti.dds.infrastructure.true if the "this" is assignable from "from". Otherwise, com.rti.dds.infrastructure.false.

◆ length()

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 com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRING or com.rti.dds.typecode.TCKind.TK_WSTRING.
MT Safety:
SAFE.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif 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.

References TCKind.TK_ARRAY, TCKind.TK_SEQUENCE, TCKind.TK_STRING, and TCKind.TK_WSTRING.

Referenced by TypeCode.cdr_serialized_sample_key_max_size(), TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.signature().

◆ name()

String name ( ) throws BadKind

Retrieves the simple name identifying this com.rti.dds.typecode.TypeCode object within its enclosing scope.

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

References TCKind.TK_ALIAS, TCKind.TK_ENUM, TCKind.TK_STRUCT, TCKind.TK_UNION, and TCKind.TK_VALUE.

Referenced by TypeCode.add_member(), DynamicDataTypeSupport.delete(), TypeCode.equal(), TypeCode.find_member_by_name(), TypeCode.print_complete_IDL(), and TypeCode.signature().

◆ is_alias_pointer()

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 com.rti.dds.typecode.TCKind.TK_ALIAS.
MT Safety:
SAFE.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
Returns
com.rti.dds.infrastructure.true if an alias is a pointer to the aliased type. Otherwise, com.rti.dds.infrastructure.false.

References TCKind.TK_ALIAS.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ type_modifier()

short type_modifier ( ) throws BadKind

Returns a constant indicating the modifier of the value type that this com.rti.dds.typecode.TypeCode object describes.

Precondition
self kind is com.rti.dds.typecode.TCKind.TK_VALUE or com.rti.dds.typecode.TCKind.TK_STRUCT.

For com.rti.dds.typecode.TCKind.TK_STRUCT, this method always returns com.rti.dds.typecode.ValueModifier.VM_NONE.

MT Safety:
SAFE.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
Returns
One of the following type modifiers: com.rti.dds.typecode.ValueModifier.VM_NONE, com.rti.dds.typecode.ValueModifier.VM_ABSTRACT, com.rti.dds.typecode.ValueModifier.VM_CUSTOM or com.rti.dds.typecode.ValueModifier.VM_TRUNCATABLE.

References TCKind.TK_STRUCT, and TCKind.TK_VALUE.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ concrete_base_type()

TypeCode concrete_base_type ( ) throws BadKind

Returns the com.rti.dds.typecode.TypeCode that describes the concrete base type of the value type that this com.rti.dds.typecode.TypeCode object describes.

Precondition
self kind is com.rti.dds.typecode.TCKind.TK_VALUE or com.rti.dds.typecode.TCKind.TK_STRUCT.
MT Safety:
SAFE.

For com.rti.dds.typecode.TCKind.TK_STRUCT, this method always returns com.rti.dds.typecode.TCKind.TK_NULL.

The com.rti.dds.typecode.TypeCode of structs inheriting from other structs has a com.rti.dds.typecode.TCKind.TK_VALUE kind.

For example:

struct MyStruct: MyBaseStruct {
long member_1;
};

The code generation for the previous type will generate a com.rti.dds.typecode.TypeCode with com.rti.dds.typecode.TCKind.TK_VALUE kind.

Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
Returns
com.rti.dds.typecode.TypeCode that describes the concrete base type or null if there is no a concrete base type.

References TypeCode.kind(), TypeCode.TC_NULL, TCKind.TK_NULL, TCKind.TK_STRUCT, and TCKind.TK_VALUE.

Referenced by TypeCode.add_member(), TypeCode.equal(), TypeCode.find_member_by_name(), TypeCode.print_complete_IDL(), and TypeCode.signature().

◆ content_type()

TypeCode content_type ( ) throws BadKind

Returns the com.rti.dds.typecode.TypeCode object representing the type for the members of the object described by this com.rti.dds.typecode.TypeCode object.

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

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

References TCKind.TK_ALIAS, TCKind.TK_ARRAY, and TCKind.TK_SEQUENCE.

Referenced by TypeCode.add_member(), TypeCode.equal(), TypeCode.find_member_by_name(), TypeCode.print_complete_IDL(), and TypeCode.signature().

◆ array_dimension_count()

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 com.rti.dds.typecode.TCKind.TK_ARRAY.
MT Safety:
SAFE.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
Returns
Number of dimensions if no errors.

References TCKind.TK_ARRAY.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), TypeCode.print_complete_IDL(), and TypeCode.signature().

◆ array_dimension()

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 com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
Requested dimension if no errors.

References TCKind.TK_ARRAY.

Referenced by TypeCode.element_count(), TypeCode.equal(), TypeCode.print_complete_IDL(), and TypeCode.signature().

◆ element_count()

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.

References TypeCode.array_dimension(), and TCKind.TK_ARRAY.

◆ member_count()

◆ member_name()

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 com.rti.dds.typecode.TypeCode objects.

Precondition
self kind is com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_UNION, com.rti.dds.typecode.TCKind.TK_ENUM or com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
Name of the member if no errors.

References TypeCode.member_count(), ValueMember.name, EnumMember.name, UnionMember.name, StructMember.name, TCKind.TK_ENUM, TCKind.TK_STRUCT, TCKind.TK_UNION, and TCKind.TK_VALUE.

Referenced by TypeCode.cdr_serialized_sample_key_max_size(), TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ member_type()

TypeCode member_type ( int  index) throws BadKind,Bounds

Retrieves the com.rti.dds.typecode.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 com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_UNION or com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
The com.rti.dds.typecode.TypeCode object describing the member at the given index if no errors.

References TypeCode.member_count(), TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_VALUE, ValueMember.type, StructMember.type, and UnionMember.type.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ member_id()

int member_id ( int  index) throws BadKind,Bounds

Returns the ID of the TypeCode member identified by the given index.

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

The method can be invoked on aggregation com.rti.dds.typecode.TypeCode objects.

All members of aggregated types have an integral member ID that uniquely identifies them within their defining type.

In IDL, you can specify the member ID using the built-in annotation ID. For example:

struct MyType {
long member_1; //@ID 200
} //@Extensibility MUTABLE_EXTENSIBILITY

In XML, you can specify the member ID using the attribute 'id':

<struct name="MyType" extensibility="mutable" id="200">
<member name="member_1" type="long"/>
</struct>

In XSD, you can specify the member ID using the built-in annotation ID

<xsd:complexType name="MyType">
<xsd:sequence>
<xsd:element name="member_1" minOccurs="1" maxOccurs="1" type="xsd:int"/>
<!-- @id 200 -->
</xsd:sequence>
</xsd:complexType>
<!-- @extensibility MUTABLE_EXTENSIBILITY -->
Precondition
self kind is com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_VALUE, or com.rti.dds.typecode.TCKind.TK_UNION
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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
ID of the member if no errors.

References UnionMember.id, ValueMember.id, StructMember.id, TypeCode.member_count(), TCKind.TK_STRUCT, TCKind.TK_UNION, and TCKind.TK_VALUE.

Referenced by TypeCode.add_member(), TypeCode.equal(), TypeCode.find_member_by_name(), TypeCode.print_complete_IDL(), and TypeCode.signature().

◆ member_label_count()

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 com.rti.dds.typecode.TypeCode objects.

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

Precondition
self kind is com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
Number of labels if no errors.

References UnionMember.labels, TypeCode.member_count(), and TCKind.TK_UNION.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ member_label()

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 com.rti.dds.typecode.TypeCode objects.

Precondition
self kind is com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
The evaluated value of the label if no errors.

References UnionMember.labels, TypeCode.member_count(), and TCKind.TK_UNION.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ member_ordinal()

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 com.rti.dds.typecode.TypeCode objects.

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

Precondition
self kind is com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
Ordinal that corresponds to the index-th enumerator if no errors.

References TypeCode.member_count(), EnumMember.ordinal, and TCKind.TK_ENUM.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ is_member_key()

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 com.rti.dds.typecode.TCKind.TK_STRUCT or com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
com.rti.dds.infrastructure.true if the member is a key. Otherwise, com.rti.dds.infrastructure.false.

References ValueMember.is_key, StructMember.is_key, TypeCode.member_count(), TCKind.TK_ENUM, TCKind.TK_NULL, TCKind.TK_STRUCT, TCKind.TK_UNION, and TCKind.TK_VALUE.

Referenced by TypeCode.equal(), and TypeCode.print_complete_IDL().

◆ is_member_required()

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.

A non-key member is required if it has not been marked as optional. All key members are required.

See also
com.rti.dds.typecode.TypeCode.NONKEY_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER
MT Safety:
SAFE.

References ValueMember.is_optional, StructMember.is_optional, TypeCode.KEY_MEMBER, TypeCode.member_count(), TypeCode.NONKEY_MEMBER, TypeCode.NONKEY_REQUIRED_MEMBER, TCKind.TK_STRUCT, TCKind.TK_UNION, and TCKind.TK_VALUE.

Referenced by TypeCode.equal(), and TypeCode.print_complete_IDL().

◆ is_member_pointer()

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 com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_UNION or com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
com.rti.dds.infrastructure.true if the member is a pointer. Otherwise, com.rti.dds.infrastructure.false.

References ValueMember.is_pointer, UnionMember.is_pointer, StructMember.is_pointer, TypeCode.member_count(), TCKind.TK_STRUCT, TCKind.TK_UNION, and TCKind.TK_VALUE.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ is_member_bitfield()

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 com.rti.dds.typecode.TCKind.TK_STRUCT or com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
com.rti.dds.infrastructure.true if the member is a bitfield. Otherwise, com.rti.dds.infrastructure.false.

References TypeCode.member_count(), TCKind.TK_STRUCT, and TCKind.TK_VALUE.

Referenced by TypeCode.equal(), and TypeCode.print_complete_IDL().

◆ member_bitfield_bits()

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 com.rti.dds.typecode.TCKind.TK_STRUCT or com.rti.dds.typecode.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.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
The number of bits of the bitfield or com.rti.dds.typecode.TypeCode.NOT_BITFIELD if the member is not a bitfield.

References ValueMember.bits, StructMember.bits, TypeCode.member_count(), TCKind.TK_STRUCT, and TCKind.TK_VALUE.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ member_visibility()

short member_visibility ( int  index) throws BadKind,Bounds

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

Precondition
self kind is com.rti.dds.typecode.TCKind.TK_VALUE or com.rti.dds.typecode.TCKind.TK_STRUCT. The index param must be in the interval [0,(member count-1)].
MT Safety:
SAFE.

For com.rti.dds.typecode.TCKind.TK_STRUCT, this method always returns com.rti.dds.typecode.Visibility.PUBLIC_MEMBER.

Parameters
index<<in>> Member index in the interval [0,(member count-1)].
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
com.rti.dds.infrastructure.ExceptionCode_t.Bounds- if the index parameter/s are out of range.
Returns
One of the following constants: com.rti.dds.typecode.Visibility.PRIVATE_MEMBER or com.rti.dds.typecode.Visibility.PUBLIC_MEMBER.

References ValueMember.access, TypeCode.member_count(), TCKind.TK_STRUCT, TCKind.TK_VALUE, and PUBLIC_MEMBER.VALUE.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ discriminator_type()

TypeCode discriminator_type ( ) throws BadKind

Returns the discriminator type code.

The method discriminator_type can be invoked only on union com.rti.dds.typecode.TypeCode objects.

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

References TCKind.TK_UNION.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ default_index()

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 com.rti.dds.typecode.TypeCode objects.

Precondition
self kind is com.rti.dds.typecode.TCKind.TK_UNION
MT Safety:
SAFE.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif 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.

References TCKind.TK_UNION.

Referenced by TypeCode.equal(), TypeCode.find_member_by_name(), and TypeCode.print_complete_IDL().

◆ find_member_by_id()

int find_member_by_id ( int  id) throws BadKind

Get the index of the member of the given ID.

This method is applicable to com.rti.dds.typecode.TypeCode objects representing structs (com.rti.dds.typecode.TCKind.TK_STRUCT) and union (com.rti.dds.typecode.TCKind.TK_UNION) types.

Parameters
id<<in>> The member ID.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
Returns
The index of the member of the given ID or com.rti.dds.typecode.TypeCode.INDEX_INVALID if the member is not found.
MT Safety:
SAFE.

References TypeCode.INDEX_INVALID, and TypeCode.member_count().

◆ find_member_by_name()

int find_member_by_name ( String  name) throws BadKind

Get the index of the member of the given name.

This method is applicable to com.rti.dds.typecode.TypeCode objects representing structs (com.rti.dds.typecode.TCKind.TK_STRUCT) and union (com.rti.dds.typecode.TCKind.TK_UNION) types.

Parameters
name<<in>> The member name.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindif the method is invoked on an inappropriate kind of TypeCode object.
Returns
The index of the member of the given name or com.rti.dds.typecode.TypeCode.INDEX_INVALID if the member is not found.
MT Safety:
SAFE.

References TypeCode.array_dimension_count(), TypeCode.concrete_base_type(), TypeCode.content_type(), TypeCode.default_index(), TypeCode.discriminator_type(), TypeCode.equals(), TypeCode.extensibility_kind(), TypeCode.INDEX_INVALID, TypeCode.is_alias_pointer(), TypeCode.is_member_pointer(), TypeCode.kind(), UnionMember.labels, TypeCode.length(), TypeCode.member_bitfield_bits(), TypeCode.member_count(), TypeCode.member_id(), TypeCode.member_label(), TypeCode.member_label_count(), TypeCode.member_name(), TypeCode.member_ordinal(), TypeCode.member_type(), TypeCode.member_visibility(), TypeCode.name(), Enum.ordinal(), TCKind.TK_ALIAS, TCKind.TK_ARRAY, TCKind.TK_BOOLEAN, TCKind.TK_CHAR, TCKind.TK_DOUBLE, TCKind.TK_ENUM, TCKind.TK_FLOAT, TCKind.TK_LONG, TCKind.TK_LONGDOUBLE, TCKind.TK_LONGLONG, TCKind.TK_NULL, TCKind.TK_OCTET, TCKind.TK_SEQUENCE, TCKind.TK_SHORT, TCKind.TK_STRING, TCKind.TK_STRUCT, TCKind.TK_ULONG, TCKind.TK_ULONGLONG, TCKind.TK_UNION, TCKind.TK_USHORT, TCKind.TK_VALUE, TCKind.TK_WCHAR, TCKind.TK_WSTRING, TypeCode.type_modifier(), and PUBLIC_MEMBER.VALUE.

◆ print_IDL() [1/2]

void print_IDL ( int  indent)

Prints a com.rti.dds.typecode.TypeCode in IDL notation.

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

Referenced by TypeCode.print_complete_IDL(), and TypeCode.print_IDL().

◆ print_IDL() [2/2]

void print_IDL ( int  indent,
Writer  out 
) throws IOException

Prints a com.rti.dds.typecode.TypeCode in a pseudo-IDL notation.

MT Safety:
SAFE.
Parameters
indent<<in>> Indent.
out<<out>> Output stream.

References TypeCode.print_IDL().

◆ print_complete_IDL()

◆ add_member() [1/2]

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

Add a new member to this com.rti.dds.typecode.TypeCode.

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

Calling this method clones the type code passed as the tc parameter if the type code is not a builtin one. To delete this cloned type code, call com.rti.dds.typecode.TypeCodeFactory.delete_tc.

The ability to modify a com.rti.dds.typecode.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",
TypeCode.MEMBER_ID_INVALID,
TypeCode.TC_LONG,
// New field is a required non-key member:
TypeCode.NONKEY_REQUIRED_MEMBER);
// Sequence of 10 or fewer integers:
myTypeCode.add_member(
"myFieldName",
TypeCode.MEMBER_ID_INVALID,
TypeCodeFactory.get_instance().create_sequence_tc(10, TypeCode.TC_LONG),
// New field is a required non-key member:
TypeCode.NONKEY_REQUIRED_MEMBER);
MT Safety:
UNSAFE.
Parameters
name<<in>> The name of the new member.
id<<in>> Member ID or case value.
tc<<in>> The type of the new member. You can get or create this com.rti.dds.typecode.TypeCode with the com.rti.dds.typecode.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
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member_to_enum
com.rti.dds.typecode.TypeCodeFactory
com.rti.dds.typecode.TypeCode.NONKEY_MEMBER
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER

References TypeCode.concrete_base_type(), TypeCode.content_type(), ValueMember.id, StructMember.id, TypeCode.INDEX_INVALID, TypeCode.kind(), TypeCode.member_count(), TypeCode.member_id(), TypeCode.MEMBER_ID_INVALID, TypeCode.name(), TCKind.TK_ALIAS, TCKind.TK_NULL, TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_VALUE, and PUBLIC_MEMBER.VALUE.

Referenced by TypeCode.add_member(), and TypeCodeFactory.get_primitive_tc().

◆ add_member() [2/2]

synchronized 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,IllegalStateException

Add a new member to this com.rti.dds.typecode.TypeCode.

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

Calling this method clones the type code passed in as the tc parameter if the type code is not a builtin one. To delete this cloned type code, call com.rti.dds.typecode.TypeCodeFactory.delete_tc.

The ability to modify a com.rti.dds.typecode.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>> Member ID or case value.
tc<<in>> The type of the new member. You can get or create this com.rti.dds.typecode.TypeCode with the com.rti.dds.typecode.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 com.rti.dds.typecode.TCKind.TK_VALUE. Possible values include:
  • com.rti.dds.typecode.Visibility.PRIVATE_MEMBER
  • com.rti.dds.typecode.Visibility.PUBLIC_MEMBER
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 com.rti.dds.typecode.TypeCode.NOT_BITFIELD.
Returns
The zero-based index of the new member relative to any other members that previously existed.
See also
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member_to_enum
com.rti.dds.typecode.TypeCode.add_member_to_union
com.rti.dds.typecode.TypeCodeFactory
com.rti.dds.typecode.TypeCode.NONKEY_MEMBER
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER

References TypeCode.add_member().

◆ add_member_to_enum()

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

Add a new enumerated constant to this enum com.rti.dds.typecode.TypeCode.

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

Modifying a com.rti.dds.typecode.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
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCodeFactory

References UnionMember.id, TypeCode.INDEX_INVALID, UnionMember.labels, TypeCode.MEMBER_ID_INVALID, TCKind.TK_ENUM, and TCKind.TK_UNION.

Referenced by TypeCodeFactory.get_primitive_tc().

◆ add_member_to_union()

synchronized int add_member_to_union ( String  name,
int  id,
int  labels_in[],
TypeCode  tc,
boolean  is_pointer 
) throws BadKind,BadMemberName, BadMemberId

Add a new member to a union com.rti.dds.typecode.TypeCode.

This method is applicable to com.rti.dds.typecode.TypeCode objects representing unions (com.rti.dds.typecode.TCKind.TK_UNION).

Modifying a com.rti.dds.typecode.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 member ID. For automatic assignment of the member ID specify com.rti.dds.typecode.TypeCode.MEMBER_ID_INVALID.
labels_in<<in>> A sequence of labels or case values associated with the member.
tc<<in>> The type of the new member. You can get or create this com.rti.dds.typecode.TypeCode with the com.rti.dds.typecode.TypeCodeFactory.
is_pointer<<in>> Whether the data member, in its deserialized form, should be stored by pointer as opposed to by value.
Exceptions
com.rti.dds.infrastructure.ExceptionCode_t.BadKindcom.rti.dds.infrastructure.ExceptionCode_t.BadMemberName com.rti.dds.infrastructure.ExceptionCode_t.BadMemberId
Returns
The zero-based index of the new member relative to any other members that previously existed.
See also
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member_to_enum
com.rti.dds.typecode.TypeCode.add_member_to_union
com.rti.dds.typecode.TypeCodeFactory
com.rti.dds.typecode.TypeCode.NONKEY_MEMBER
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER

References TypeCode.INDEX_INVALID.

◆ signature()

◆ cdr_serialized_sample_min_size() [1/2]

final long cdr_serialized_sample_min_size ( short  representation_id) throws UserException, SystemException

Gets the minimum serialized size of samples of this type.

Obtains the minimum possible size in bytes of any serialized data sample of this type.

Precondition
The type is an aggregation type (struct, union)
Parameters
representation_idThe serialized data representation for which we calculate the minimum size.
Returns
The minimum size

◆ cdr_serialized_sample_min_size() [2/2]

final long cdr_serialized_sample_min_size ( ) throws UserException, SystemException

Gets the minimum serialized size of samples of this type.

Obtains the minimum possible size in bytes of any serialized data sample of this type.

Assumes the com.rti.dds.infrastructure.DataRepresentationId_t to be DDS_AUTO_DATA_REPRESENTATION

Precondition
The type is an aggregation type (struct, union)
Returns
The minimum size

References DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION.

◆ cdr_serialized_sample_max_size() [1/2]

final long cdr_serialized_sample_max_size ( short  representation_id) throws UserException, SystemException

Gets the maximum serialized size of samples of this type.

Obtains the maximum possible size in bytes of any serialized data sample of this type.

Precondition
The type is an aggregation type (struct, union)
Parameters
representation_idThe serialized data representation for which we calculate the maximum size.
Returns
The maximum size

◆ cdr_serialized_sample_max_size() [2/2]

final long cdr_serialized_sample_max_size ( ) throws UserException, SystemException

Gets the maximum serialized size of samples of this type.

Obtains the maximum possible size in bytes of any serialized data sample of this type.

Assumes the com.rti.dds.infrastructure.DataRepresentationId_t to be DDS_AUTO_DATA_REPRESENTATION

Precondition
The type is an aggregation type (struct, union)
Returns
The maximum size

References DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION.

◆ cdr_serialized_sample_key_max_size() [1/2]

final long cdr_serialized_sample_key_max_size ( short  representation_id) throws UserException, SystemException

Gets the maximum serialized size of sample keys of this type.

Obtains the maximum possible size in bytes of the serialized keys of any data sample of this type

Precondition
The type is an aggregation type (struct, union)
Parameters
representation_idThe serialized data representation for which we calculate the maximum key size.
Returns
The maximum key size

◆ cdr_serialized_sample_key_max_size() [2/2]

final long cdr_serialized_sample_key_max_size ( ) throws UserException, SystemException

Gets the maximum serialized size of sample keys of this type.

Obtains the maximum possible size in bytes of the serialized keys of any data sample of this type

Assumes the com.rti.dds.infrastructure.DataRepresentationId_t to be DDS_AUTO_DATA_REPRESENTATION

Precondition
The type is an aggregation type (struct, union)
Returns
The maximum key size

References IntSeq.addAllInt(), DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION, ExtensibilityKind.FINAL_EXTENSIBILITY, TypeCode.kind(), TypeCode.length(), TypeCode.member_count(), TypeCode.member_name(), ExtensibilityKind.MUTABLE_EXTENSIBILITY, Enum.ordinal(), TCKind.TK_ALIAS, TCKind.TK_ARRAY, TCKind.TK_ENUM, TCKind.TK_SEQUENCE, TCKind.TK_STRING, TCKind.TK_STRUCT, TCKind.TK_UNION, TCKind.TK_VALUE, TCKind.TK_WSTRING, ValueMember.type, StructMember.type, UnionMember.type, and PUBLIC_MEMBER.VALUE.

◆ get_type_object_serialized_size()

long get_type_object_serialized_size ( )

Gets the serialized size of the TypeObject created from this com.rti.dds.typecode.TypeCode.

The default buffer size used for storing a TypeObject is 8192 bytes. For a large TypeObject, this API can be used to determine the size that needs to be set in com.rti.dds.infrastructure.DomainParticipantResourceLimitsQosPolicy.type_object_max_serialized_length

MT Safety:
SAFE.
Returns
The TypeObject serialized size.

Member Data Documentation

◆ TC_NULL

◆ TC_SHORT

final TypeCode TC_SHORT
static

Basic 16-bit signed integer type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_LONG

final TypeCode TC_LONG
static

Basic 32-bit signed integer type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_USHORT

final TypeCode TC_USHORT
static

Basic unsigned 16-bit integer type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_ULONG

final TypeCode TC_ULONG
static

Basic unsigned 32-bit integer type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_FLOAT

final TypeCode TC_FLOAT
static

Basic 32-bit floating point type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_DOUBLE

final TypeCode TC_DOUBLE
static

Basic 64-bit floating point type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_BOOLEAN

final TypeCode TC_BOOLEAN
static

◆ TC_CHAR

final TypeCode TC_CHAR
static

Basic single-byte character type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_OCTET

final TypeCode TC_OCTET
static

◆ TC_LONGLONG

final TypeCode TC_LONGLONG
static

◆ TC_ULONGLONG

final TypeCode TC_ULONGLONG
static

Basic unsigned 64-bit integer type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_LONGDOUBLE

final TypeCode TC_LONGDOUBLE
static

Basic 128-bit floating point type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ TC_WCHAR

final TypeCode TC_WCHAR
static

Basic four-byte character type.

See also
com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc

Referenced by TypeCodeFactory.get_primitive_tc().

◆ MEMBER_ID_INVALID

final int MEMBER_ID_INVALID
static

◆ MAX_MEMBER_ID

final int MAX_MEMBER_ID
static

Maximum value for member id. ID.

This value was introduced with the Extensible Types specification

◆ INDEX_INVALID

◆ NONKEY_MEMBER

final byte NONKEY_MEMBER
static

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

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 com.rti.dds.typecode.TypeCode.NONKEY_MEMBER field if one has been explicitly set (see, for example, com.rti.dds.dynamicdata.DynamicData.DynamicData.set_int). The middleware will not assume any default value.

See also
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.is_member_key
com.rti.dds.typecode.TypeCode.is_member_required
com.rti.dds.typecode.StructMember.is_key
com.rti.dds.typecode.ValueMember.is_key

Referenced by TypeCode.is_member_required().

◆ KEY_MEMBER

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 com.rti.dds.typecode.TypeCode.KEY_MEMBER fields. If you do not set a value of the member explicitly (see, for example, com.rti.dds.dynamicdata.DynamicData.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
com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_MEMBER
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.is_member_key
com.rti.dds.typecode.TypeCode.is_member_required
com.rti.dds.typecode.StructMember.is_key
com.rti.dds.typecode.ValueMember.is_key

Referenced by TypeCode.is_member_required().

◆ NONKEY_REQUIRED_MEMBER

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 com.rti.dds.typecode.TypeCode.NONKEY_REQUIRED_MEMBER fields. If you do not set a value of the member explicitly (see, for example, com.rti.dds.dynamicdata.DynamicData.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
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.NONKEY_MEMBER
com.rti.dds.typecode.TypeCode.KEY_MEMBER
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.add_member
com.rti.dds.typecode.TypeCode.is_member_key
com.rti.dds.typecode.TypeCode.is_member_required
com.rti.dds.typecode.StructMember.is_key
com.rti.dds.typecode.ValueMember.is_key

Referenced by TypeCode.is_member_required().

◆ NOT_BITFIELD

final short NOT_BITFIELD
static

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