RTI Connext Java API
Version 5.0.0
|
A singleton factory for creating, copying, and deleting data type definitions dynamically. More...
Static Public Member Functions | |
static final TypeCodeFactory | get_instance () |
Gets the singleton instance of this class. | |
A singleton factory for creating, copying, and deleting data type definitions dynamically.
You can access the singleton with the com.rti.dds.typecode.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 com.rti.dds.typecode.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.
Creating definitions for strings, arrays, and sequences:
Type definitions for strings, arrays, and sequences (i.e. variables-size lists) must be created as you need them, because the type definition includes the maximum length of those containers.
Creating definitions for structured types:
Structured types include structures, value types, sparse value types, and unions.
Creating definitions for other types:
The type system also supports enumerations and aliases (i.e. typedef
s in C and C++).
Deleting type definitions:
When you're finished using a type definition, you should delete it. (Note that you only need to delete a com.rti.dds.typecode.TypeCode that you created; if you got the object from com.rti.dds.typecode.TypeCodeFactory.get_primitive_tc, you must not delete it.)
Copying type definitions:
You can also create deep copies of type definitions:
|
static |
Gets the singleton instance of this class.
TypeCode create_struct_tc | ( | String | name, |
ExtensibilityKind | extensibility_kind, | ||
StructMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_STRUCT com.rti.dds.typecode.TypeCode.
name | <<in>> Name of the struct type. Cannot be null. |
extensibility_kind | <<in>> Type extensibility. |
members | <<in>> Initial members of the structure. This list may be empty (that is, com.rti.dds.infrastructure.com.rti.dds.util.Sequence.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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_struct_tc | ( | String | name, |
StructMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_STRUCT com.rti.dds.typecode.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, com.rti.dds.infrastructure.com.rti.dds.util.Sequence.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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_value_tc | ( | String | name, |
ExtensibilityKind | extensibility_kind, | ||
short | type_modifier, | ||
TypeCode | concrete_base, | ||
ValueMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_VALUE com.rti.dds.typecode.TypeCode.
name | <<in>> Name of the value type. Cannot be null. |
extensibility_kind | <<in>> Type extensibility. |
type_modifier | <<in>> One of the value type modifier constants: com.rti.dds.typecode.ValueModifier.VM_NONE, com.rti.dds.typecode.ValueModifier.VM_CUSTOM, com.rti.dds.typecode.ValueModifier.VM_ABSTRACT or com.rti.dds.typecode.ValueModifier.VM_TRUNCATABLE. |
concrete_base | <<in>> com.rti.dds.typecode.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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_value_tc | ( | String | name, |
short | type_modifier, | ||
TypeCode | concrete_base, | ||
ValueMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_VALUE com.rti.dds.typecode.TypeCode.
name | <<in>> Name of the value type. Cannot be null. |
type_modifier | <<in>> One of the value type modifier constants: com.rti.dds.typecode.ValueModifier.VM_NONE, com.rti.dds.typecode.ValueModifier.VM_CUSTOM, com.rti.dds.typecode.ValueModifier.VM_ABSTRACT or com.rti.dds.typecode.ValueModifier.VM_TRUNCATABLE. |
concrete_base | <<in>> com.rti.dds.typecode.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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_sparse_tc | ( | String | name, |
short | type_modifier, | ||
TypeCode | concrete_base | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_SPARSE com.rti.dds.typecode.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: com.rti.dds.typecode.ValueModifier.VM_NONE, com.rti.dds.typecode.ValueModifier.VM_CUSTOM, com.rti.dds.typecode.ValueModifier.VM_ABSTRACT or com.rti.dds.typecode.ValueModifier.VM_TRUNCATABLE. |
concrete_base | <<in>> com.rti.dds.typecode.TypeCode object describing the concrete valuetype base. It may be null if the valuetype does not have a concrete base. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_union_tc | ( | String | name, |
ExtensibilityKind | extensibility_kind, | ||
TypeCode | discriminator_type, | ||
int | default_index, | ||
UnionMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_UNION com.rti.dds.typecode.TypeCode.
name | <<in>> Name of the union type. Cannot be null. |
extensibility_kind | <<in>> Type extensibility. |
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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_union_tc | ( | String | name, |
TypeCode | discriminator_type, | ||
int | default_index, | ||
UnionMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_UNION com.rti.dds.typecode.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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_enum_tc | ( | String | name, |
ExtensibilityKind | extensibility_kind, | ||
EnumMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_ENUM com.rti.dds.typecode.TypeCode.
name | <<in>> Name of the enum type. Cannot be null. |
extensibility_kind | <<in>> Type extensibility. |
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 com.rti.dds.typecode.TypeCode.add_member_to_enum. This argument may be null. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_enum_tc | ( | String | name, |
EnumMember[] | members | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_ENUM com.rti.dds.typecode.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 com.rti.dds.typecode.TypeCode.add_member_to_enum. This argument may be null. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
TypeCode create_alias_tc | ( | String | name, |
TypeCode | original_type, | ||
boolean | is_pointer | ||
) | throws BAD_PARAM |
Constructs a com.rti.dds.typecode.TCKind.TK_ALIAS (typedef) com.rti.dds.typecode.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.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
Constructs a com.rti.dds.typecode.TCKind.TK_STRING com.rti.dds.typecode.TypeCode.
bound | <<in>> Maximum length of the string. It cannot be negative. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
Constructs a com.rti.dds.typecode.TCKind.TK_WSTRING com.rti.dds.typecode.TypeCode.
bound | <<in>> Maximum length of the wide string. It cannot be negative. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
Constructs a com.rti.dds.typecode.TCKind.TK_SEQUENCE com.rti.dds.typecode.TypeCode.
bound | <<in>> The bound for the sequence (> 0). |
element_type | <<in>> com.rti.dds.typecode.TypeCode object describing the sequence elements. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
Constructs a com.rti.dds.typecode.TCKind.TK_ARRAY com.rti.dds.typecode.TypeCode.
dimensions | <<in>> Dimensions of the array. Each dimension has to be greater than 0. |
element_type | <<in>> com.rti.dds.typecode.TypeCode describing the array elements. Cannot be null. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
Constructs a com.rti.dds.typecode.TCKind.TK_ARRAY com.rti.dds.typecode.TypeCode for a single-dimensional array.
length | <<in>> Length of the single-dimensional array. |
element_type | <<in>> com.rti.dds.typecode.TypeCode describing the array elements. Cannot be null. |
com.rti.dds.infrastructure.ExceptionCode_t.BAD_PARAM. | Illegal parameter value. |
Creates and returns a copy of the input com.rti.dds.typecode.TypeCode.
tc | <<in>> Type code that will be copied. Cannot be null. |
void delete_tc | ( | TypeCode | tc | ) |
Deletes the input com.rti.dds.typecode.TypeCode.
Calling this method is optional. If you do not call it, the garbage collector will perform the deletion when it is able.
tc | <<inout>> Type code that will be deleted. Cannot be null. |
Get the com.rti.dds.typecode.TypeCode for a primitive type (integers, floating point values, etc.) identified by the given com.rti.dds.typecode.TCKind.