Public Member Functions | |
TypeCode | create_struct_tc (String name, StructMember[] members) throws BAD_PARAM |
Constructs a TCKind.TK_STRUCT TypeCode. | |
TypeCode | create_value_tc (String name, short type_modifier, TypeCode concrete_base, ValueMember[] members) throws BAD_PARAM |
Constructs a TCKind.TK_VALUE TypeCode. | |
TypeCode | create_sparse_tc (String name, short type_modifier, TypeCode concrete_base) throws BAD_PARAM |
Constructs a TCKind.TK_SPARSE TypeCode. | |
TypeCode | create_union_tc (String name, TypeCode discriminator_type, int default_index, UnionMember[] members) throws BAD_PARAM |
Constructs a TCKind.TK_UNION TypeCode. | |
TypeCode | create_enum_tc (String name, EnumMember[] members) throws BAD_PARAM |
Constructs a TCKind.TK_ENUM TypeCode. | |
TypeCode | create_alias_tc (String name, TypeCode original_type, boolean is_pointer) throws BAD_PARAM |
Constructs a TCKind.TK_ALIAS (typedef) TypeCode. | |
TypeCode | create_string_tc (int bound) throws BAD_PARAM |
Constructs a TCKind.TK_STRING TypeCode. | |
TypeCode | create_wstring_tc (int bound) throws BAD_PARAM |
Constructs a TCKind.TK_WSTRING TypeCode. | |
TypeCode | create_sequence_tc (int bound, TypeCode element_type) throws BAD_PARAM |
Constructs a TCKind.TK_SEQUENCE TypeCode. | |
TypeCode | create_array_tc (int[] dimensions, TypeCode element_type) throws BAD_PARAM |
Constructs a TCKind.TK_ARRAY TypeCode. | |
TypeCode | create_array_tc (int length, TypeCode element_type) throws BAD_PARAM |
Constructs a TCKind.TK_ARRAY TypeCode for a single-dimensional array. | |
TypeCode | clone_tc (TypeCode tc) |
Creates and returns a copy of the input TypeCode. | |
void | delete_tc (TypeCode tc) |
Deletes the input TypeCode. | |
TypeCode | get_primitive_tc (TCKind kind) throws BAD_PARAM |
Get the TypeCode for a primitive type (integers, floating point values, etc.) identified by the given TCKind. | |
Static Public Member Functions | |
static final TypeCodeFactory | get_instance () |
Gets the singleton instance of this class. |
You can access the singleton with the TypeCodeFactory.get_instance method.
If you want to publish and subscribe to data of types that are not known to you at system design time, this class will be your starting point. After creating a data type definition with this class, you will modify that definition using the TypeCode class and then register it with the Dynamic Data API.
The methods of this class fall into several categories:
Getting definitions for primitive types:
Type definitions for primitive types (e.g. integers, floating point values, etc.) are pre-defined; your application only needs to get them, not create them.
typedef
s in C and C++).
Deleting type definitions:static final TypeCodeFactory get_instance | ( | ) | [static] |
Gets the singleton instance of this class.
TypeCode create_struct_tc | ( | String | name, | |
StructMember[] | members | |||
) | throws BAD_PARAM |
Constructs a TCKind.TK_STRUCT TypeCode.
name | <<in>> Name of the struct type. Cannot be null. | |
members | <<in>> Initial members of the structure. This list may be empty (that is, Sequence.size() may return zero). If the list is not empty, the elements must describe valid struct members. (For example, the names must be unique within the type.) This argument may be null. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
TypeCode create_value_tc | ( | String | name, | |
short | type_modifier, | |||
TypeCode | concrete_base, | |||
ValueMember[] | members | |||
) | throws BAD_PARAM |
Constructs a TCKind.TK_VALUE TypeCode.
name | <<in>> Name of the value type. Cannot be null. | |
type_modifier | <<in>> One of the value type modifier constants: VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE. | |
concrete_base | <<in>> TypeCode object describing the concrete valuetype base. It may be null if the valuetype does not have a concrete base. | |
members | <<in>> Initial members of the value type. This list may be empty. If the list is not empty, the elements must describe valid value type members. (For example, the names must be unique within the type.) This argument may be null. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
TypeCode create_sparse_tc | ( | String | name, | |
short | type_modifier, | |||
TypeCode | concrete_base | |||
) | throws BAD_PARAM |
Constructs a TCKind.TK_SPARSE TypeCode.
A sparse value type is similar to other value types but with one major difference: not all members need to be present in every sample.
It is not possible to generate code for sparse value types; they must be created at runtime using these APIs. You will interact with samples of sparse types using the Dynamic Data APIs.
name | <<in>> Name of the value type. Cannot be null. | |
type_modifier | <<in>> One of the value type modifier constants: VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE. | |
concrete_base | <<in>> TypeCode object describing the concrete valuetype base. It may be null if the valuetype does not have a concrete base. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
TypeCode create_union_tc | ( | String | name, | |
TypeCode | discriminator_type, | |||
int | default_index, | |||
UnionMember[] | members | |||
) | throws BAD_PARAM |
Constructs a TCKind.TK_UNION TypeCode.
name | <<in>> Name of the union type. Cannot be null. | |
discriminator_type | <<in>> Discriminator Type Code. Cannot be null. | |
default_index | <<in>> Index of the default member, or -1 if there is no default member. | |
members | <<in>> Initial members of the union. This list may be empty. If the list is not empty, the elements must describe valid struct members. (For example, the names must be unique within the type.) This argument may be null. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
TypeCode create_enum_tc | ( | String | name, | |
EnumMember[] | members | |||
) | throws BAD_PARAM |
Constructs a TCKind.TK_ENUM TypeCode.
name | <<in>> Name of the enum type. Cannot be null. | |
members | <<in>> Initial members of the enumeration. All members must have non-null names, and both names and ordinal values must be unique within the type. Note that it is also possible to add members later with TypeCode.add_member_to_enum. This argument may be null. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
TypeCode create_alias_tc | ( | String | name, | |
TypeCode | original_type, | |||
boolean | is_pointer | |||
) | throws BAD_PARAM |
Constructs a TCKind.TK_ALIAS (typedef) TypeCode.
name | <<in>> Name of the alias. Cannot be null. | |
original_type | <<in>> Aliased type code. Cannot be null. | |
is_pointer | <<in>> Indicates if the alias is a pointer to the aliased type code. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
Constructs a TCKind.TK_STRING TypeCode.
bound | <<in>> Maximum length of the string. It cannot be negative. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
Constructs a TCKind.TK_WSTRING TypeCode.
bound | <<in>> Maximum length of the wide string. It cannot be negative. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
Constructs a TCKind.TK_SEQUENCE TypeCode.
bound | <<in>> The bound for the sequence (> 0). | |
element_type | <<in>> TypeCode object describing the sequence elements. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
Constructs a TCKind.TK_ARRAY TypeCode.
dimensions | <<in>> Dimensions of the array. Each dimension has to be greater than 0. | |
element_type | <<in>> TypeCode describing the array elements. Cannot be null. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
Constructs a TCKind.TK_ARRAY TypeCode for a single-dimensional array.
length | <<in>> Length of the single-dimensional array. | |
element_type | <<in>> TypeCode describing the array elements. Cannot be null. |
com.rti.dds.infrastructure.BAD_PARAM. | Illegal parameter value. |
void delete_tc | ( | TypeCode | tc | ) |