RTI Connext .Net APIs  Version 5.2.0
 All Classes Namespaces Functions Variables Enumerations Properties Groups Pages
DDS::TypeCodeFactory Class Reference

A singleton factory for creating, copying, and deleting data type definitions dynamically. More...

#include <managed_typecode.h>

Public Member Functions

TypeCodeclone_tc (TypeCode^ tc)
 Creates and returns a copy of the input DDS::TypeCode.
 
void delete_tc (TypeCode^ tc)
 Deletes the input DDS::TypeCode.
 
TypeCodeget_primitive_tc (TCKind tc_kind)
 Get the DDS::TypeCode for a primitive type (integers, floating point values, etc.) identified by the given ::DDS::TCKind.
 
TypeCodecreate_struct_tc (System::String^ name, StructMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_STRUCT DDS::TypeCode.
 
TypeCodecreate_struct_tc (System::String^ name, ExtensibilityKind extensibility_kind, StructMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_STRUCT DDS::TypeCode.
 
TypeCodecreate_value_tc (System::String^ name, ValueModifier type_modifier, TypeCode^ concrete_base, ValueMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_VALUE DDS::TypeCode.
 
TypeCodecreate_value_tc (System::String^ name, ExtensibilityKind extensibility_kind, ValueModifier type_modifier, TypeCode^ concrete_base, ValueMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_VALUE DDS::TypeCode.
 
TypeCodecreate_union_tc (System::String^ name, TypeCode^ discriminator_type, System::Int32 default_index, UnionMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_UNION DDS::TypeCode.
 
TypeCodecreate_union_tc (System::String^ name, ExtensibilityKind extensibility_kind, TypeCode^ discriminator_type, System::Int32 default_index, UnionMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_UNION DDS::TypeCode.
 
TypeCodecreate_enum_tc (System::String^ name, EnumMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_ENUM DDS::TypeCode.
 
TypeCodecreate_enum_tc (System::String^ name, ExtensibilityKind extensibility_kind, EnumMemberSeq^ members)
 Constructs a ::DDS::TCKind::TK_ENUM DDS::TypeCode.
 
TypeCodecreate_alias_tc (System::String^ name, TypeCode^ original_type, System::Boolean is_pointer)
 Constructs a ::DDS::TCKind::TK_ALIAS (typedef) DDS::TypeCode.
 
TypeCodecreate_string_tc (System::UInt32 bound)
 Constructs a ::DDS::TCKind::TK_STRING DDS::TypeCode.
 
TypeCodecreate_wstring_tc (System::UInt32 bound)
 Constructs a ::DDS::TCKind::TK_WSTRING DDS::TypeCode.
 
TypeCodecreate_sequence_tc (System::UInt32 bound, TypeCode^ element_type)
 Constructs a ::DDS::TCKind::TK_SEQUENCE DDS::TypeCode.
 
TypeCodecreate_array_tc (UnsignedIntSeq^ dimensions, TypeCode^ element_type)
 Constructs a ::DDS::TCKind::TK_ARRAY DDS::TypeCode.
 
TypeCodecreate_array_tc (UInt32 length, TypeCode^ element_type)
 Constructs a ::DDS::TCKind::TK_ARRAY DDS::TypeCode for a single-dimensional array.
 

Static Public Member Functions

static TypeCodeFactoryget_instance ()
 Gets the singleton instance of this class.
 

Detailed Description

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. typedefs 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:

Member Function Documentation

static TypeCodeFactory ^ DDS::TypeCodeFactory::get_instance ( )
static

Gets the singleton instance of this class.

Returns
The DDS::TypeCodeFactory instance if no errors. Otherwise, null.
TypeCode ^ DDS::TypeCodeFactory::clone_tc ( TypeCode tc)

Creates and returns a copy of the input DDS::TypeCode.

Parameters
tc<<in>> Type code that will be copied. Cannot be null.
Returns
A clone of tc.
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.

Parameters
tc<<inout>> Type code that will be deleted. Cannot be null.
TypeCode ^ DDS::TypeCodeFactory::get_primitive_tc ( TCKind  tc_kind)
TypeCode ^ DDS::TypeCodeFactory::create_struct_tc ( System::String^  name,
StructMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_STRUCT DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a struct.
TypeCode ^ DDS::TypeCodeFactory::create_struct_tc ( System::String^  name,
ExtensibilityKind  extensibility_kind,
StructMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_STRUCT DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a struct.
TypeCode ^ DDS::TypeCodeFactory::create_value_tc ( System::String^  name,
ValueModifier  type_modifier,
TypeCode concrete_base,
ValueMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_VALUE DDS::TypeCode.

Parameters
name<<in>> Name of the value type. Cannot be null.
type_modifier<<in>> One of the value type modifier constants: ::DDS::ValueModifier::VM_NONE, ::DDS::ValueModifier::VM_CUSTOM, ::DDS::ValueModifier::VM_ABSTRACT or ::DDS::ValueModifier::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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a value.
TypeCode ^ DDS::TypeCodeFactory::create_value_tc ( System::String^  name,
ExtensibilityKind  extensibility_kind,
ValueModifier  type_modifier,
TypeCode concrete_base,
ValueMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_VALUE DDS::TypeCode.

Parameters
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: ::DDS::ValueModifier::VM_NONE, ::DDS::ValueModifier::VM_CUSTOM, ::DDS::ValueModifier::VM_ABSTRACT or ::DDS::ValueModifier::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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a value.
TypeCode ^ DDS::TypeCodeFactory::create_union_tc ( System::String^  name,
TypeCode discriminator_type,
System::Int32  default_index,
UnionMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_UNION DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a union.
TypeCode ^ DDS::TypeCodeFactory::create_union_tc ( System::String^  name,
ExtensibilityKind  extensibility_kind,
TypeCode discriminator_type,
System::Int32  default_index,
UnionMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_UNION DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a union.
TypeCode ^ DDS::TypeCodeFactory::create_enum_tc ( System::String^  name,
EnumMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_ENUM DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing an enumeration.
TypeCode ^ DDS::TypeCodeFactory::create_enum_tc ( System::String^  name,
ExtensibilityKind  extensibility_kind,
EnumMemberSeq members 
)

Constructs a ::DDS::TCKind::TK_ENUM DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing an enumeration.
TypeCode ^ DDS::TypeCodeFactory::create_alias_tc ( System::String^  name,
TypeCode original_type,
System::Boolean  is_pointer 
)

Constructs a ::DDS::TCKind::TK_ALIAS (typedef) DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing an alias.
TypeCode ^ DDS::TypeCodeFactory::create_string_tc ( System::UInt32  bound)

Constructs a ::DDS::TCKind::TK_STRING DDS::TypeCode.

Parameters
bound<<in>> Maximum length of the string.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a string.
TypeCode ^ DDS::TypeCodeFactory::create_wstring_tc ( System::UInt32  bound)

Constructs a ::DDS::TCKind::TK_WSTRING DDS::TypeCode.

Parameters
bound<<in>> Maximum length of the wide string.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a wide string.
TypeCode ^ DDS::TypeCodeFactory::create_sequence_tc ( System::UInt32  bound,
TypeCode element_type 
)

Constructs a ::DDS::TCKind::TK_SEQUENCE DDS::TypeCode.

Parameters
bound<<in>> The bound for the sequence (> 0).
element_type<<in>> DDS::TypeCode object describing the sequence elements.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a sequence.
TypeCode ^ DDS::TypeCodeFactory::create_array_tc ( UnsignedIntSeq dimensions,
TypeCode element_type 
)

Constructs a ::DDS::TCKind::TK_ARRAY DDS::TypeCode.

Parameters
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.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a sequence.
TypeCode ^ DDS::TypeCodeFactory::create_array_tc ( UInt32  length,
TypeCode element_type 
)

Constructs a ::DDS::TCKind::TK_ARRAY DDS::TypeCode for a single-dimensional array.

Parameters
length<<in>> Length of the single-dimensional array.
element_type<<in>> DDS::TypeCode describing the array elements. Cannot be null.
Exceptions
::DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE.Illegal parameter value.
Returns
A newly-created DDS::TypeCode object describing a sequence.

RTI Connext .Net APIs Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc