RTI Connext .NET API (legacy)
Version 6.1.2
|
A singleton factory for creating, copying, and deleting data type definitions dynamically. More...
#include <managed_typecode.h>
Public Member Functions | |
TypeCode ^ | clone_tc (TypeCode^ tc) |
Creates and returns a copy of the input DDS::TypeCode. More... | |
void | delete_tc (TypeCode^ tc) |
Deletes the input DDS::TypeCode. More... | |
TypeCode ^ | get_primitive_tc (TCKind tc_kind) |
Get the DDS::TypeCode for a primitive type (integers, floating point values, etc.) identified by the given DDS::TCKind. More... | |
TypeCode ^ | create_struct_tc (System::String^ name, StructMemberSeq^ members) |
Constructs a TK_STRUCT DDS::TypeCode. More... | |
TypeCode ^ | create_struct_tc (System::String^ name, ExtensibilityKind extensibility_kind, StructMemberSeq^ members) |
Constructs a TK_STRUCT DDS::TypeCode. More... | |
TypeCode ^ | create_value_tc (System::String^ name, ValueModifier type_modifier, TypeCode^ concrete_base, ValueMemberSeq^ members) |
Constructs a TK_VALUE DDS::TypeCode. More... | |
TypeCode ^ | create_value_tc (System::String^ name, ExtensibilityKind extensibility_kind, ValueModifier type_modifier, TypeCode^ concrete_base, ValueMemberSeq^ members) |
Constructs a TK_VALUE DDS::TypeCode. More... | |
TypeCode ^ | create_union_tc (System::String^ name, TypeCode^ discriminator_type, System::Int32 default_index, UnionMemberSeq^ members) |
Constructs a TK_UNION DDS::TypeCode. More... | |
TypeCode ^ | create_union_tc (System::String^ name, ExtensibilityKind extensibility_kind, TypeCode^ discriminator_type, System::Int32 default_index, UnionMemberSeq^ members) |
Constructs a TK_UNION DDS::TypeCode. More... | |
TypeCode ^ | create_enum_tc (System::String^ name, EnumMemberSeq^ members) |
Constructs a TK_ENUM DDS::TypeCode. More... | |
TypeCode ^ | create_enum_tc (System::String^ name, ExtensibilityKind extensibility_kind, EnumMemberSeq^ members) |
Constructs a TK_ENUM DDS::TypeCode. More... | |
TypeCode ^ | create_alias_tc (System::String^ name, TypeCode^ original_type, System::Boolean is_pointer) |
Constructs a TK_ALIAS (typedef) DDS::TypeCode. More... | |
TypeCode ^ | create_string_tc (System::UInt32 bound) |
Constructs a TK_STRING DDS::TypeCode. More... | |
TypeCode ^ | create_wstring_tc (System::UInt32 bound) |
Constructs a TK_WSTRING DDS::TypeCode. More... | |
TypeCode ^ | create_sequence_tc (System::UInt32 bound, TypeCode^ element_type) |
Constructs a TK_SEQUENCE DDS::TypeCode. More... | |
TypeCode ^ | create_array_tc (UnsignedIntSeq^ dimensions, TypeCode^ element_type) |
Constructs a TK_ARRAY DDS::TypeCode. More... | |
TypeCode ^ | create_array_tc (UInt32 length, TypeCode^ element_type) |
Constructs a TK_ARRAY DDS::TypeCode for a single-dimensional array. More... | |
Static Public Member Functions | |
static TypeCodeFactory ^ | get_instance () |
Gets the singleton instance of this class. More... | |
A singleton factory for creating, copying, and deleting data type definitions dynamically.
You can access the singleton with the DDS::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 DDS::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, 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 DDS::TypeCode that you created; if you got the object from DDS::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.
Creates and returns a copy of the input DDS::TypeCode.
tc | <<in>> Type code that will be copied. Cannot be null. |
void DDS::TypeCodeFactory::delete_tc | ( | TypeCode^ | tc | ) |
Deletes the input DDS::TypeCode.
All the type codes created through the DDS::TypeCodeFactory must be deleted using this method.
tc | <<inout>> Type code that will be deleted. Cannot be null. |
Get the DDS::TypeCode for a primitive type (integers, floating point values, etc.) identified by the given DDS::TCKind.
TypeCode ^ DDS::TypeCodeFactory::create_struct_tc | ( | System::String^ | name, |
StructMemberSeq^ | members | ||
) |
Constructs a TK_STRUCT DDS::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, DDS::Sequence::length 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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_struct_tc | ( | System::String^ | name, |
ExtensibilityKind | extensibility_kind, | ||
StructMemberSeq^ | members | ||
) |
Constructs a TK_STRUCT DDS::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, DDS::Sequence::length 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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_value_tc | ( | System::String^ | name, |
ValueModifier | type_modifier, | ||
TypeCode^ | concrete_base, | ||
ValueMemberSeq^ | members | ||
) |
Constructs a TK_VALUE DDS::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>> DDS::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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_value_tc | ( | System::String^ | name, |
ExtensibilityKind | extensibility_kind, | ||
ValueModifier | type_modifier, | ||
TypeCode^ | concrete_base, | ||
ValueMemberSeq^ | members | ||
) |
Constructs a TK_VALUE DDS::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: VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE. |
concrete_base | <<in>> DDS::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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_union_tc | ( | System::String^ | name, |
TypeCode^ | discriminator_type, | ||
System::Int32 | default_index, | ||
UnionMemberSeq^ | members | ||
) |
Constructs a TK_UNION DDS::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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_union_tc | ( | System::String^ | name, |
ExtensibilityKind | extensibility_kind, | ||
TypeCode^ | discriminator_type, | ||
System::Int32 | default_index, | ||
UnionMemberSeq^ | members | ||
) |
Constructs a TK_UNION DDS::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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_enum_tc | ( | System::String^ | name, |
EnumMemberSeq^ | members | ||
) |
Constructs a TK_ENUM DDS::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 DDS::TypeCode::add_member_to_enum. This argument may be null. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_enum_tc | ( | System::String^ | name, |
ExtensibilityKind | extensibility_kind, | ||
EnumMemberSeq^ | members | ||
) |
Constructs a TK_ENUM DDS::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 DDS::TypeCode::add_member_to_enum. This argument may be null. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_alias_tc | ( | System::String^ | name, |
TypeCode^ | original_type, | ||
System::Boolean | is_pointer | ||
) |
Constructs a TK_ALIAS (typedef) DDS::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. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_string_tc | ( | System::UInt32 | bound | ) |
Constructs a TK_STRING DDS::TypeCode.
bound | <<in>> Maximum length of the string. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_wstring_tc | ( | System::UInt32 | bound | ) |
Constructs a TK_WSTRING DDS::TypeCode.
bound | <<in>> Maximum length of the wide string. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_sequence_tc | ( | System::UInt32 | bound, |
TypeCode^ | element_type | ||
) |
Constructs a TK_SEQUENCE DDS::TypeCode.
bound | <<in>> The bound for the sequence (> 0). |
element_type | <<in>> DDS::TypeCode object describing the sequence elements. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
TypeCode ^ DDS::TypeCodeFactory::create_array_tc | ( | UnsignedIntSeq^ | dimensions, |
TypeCode^ | element_type | ||
) |
Constructs a TK_ARRAY DDS::TypeCode.
dimensions | <<in>> Dimensions of the array. Each dimension has to be greater than 0. |
element_type | <<in>> DDS::TypeCode describing the array elements. Cannot be null. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |
Constructs a TK_ARRAY DDS::TypeCode for a single-dimensional array.
length | <<in>> Length of the single-dimensional array. |
element_type | <<in>> DDS::TypeCode describing the array elements. Cannot be null. |
DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE. | Illegal parameter value. |