#include <managed_typecode.h>
Public Member Functions | |
TCKind | kind () |
Gets the DDS::TCKind value of a type code. | |
System::Boolean | equal (TypeCode^ tc) |
Compares two DDS::TypeCode objects for equality. | |
System::String^ | name () |
Retrieves the simple name identifying this DDS::TypeCode object within its enclosing scope. | |
System::UInt32 | member_count () |
Returns the number of members of the type code. | |
System::String^ | member_name (System::UInt32 index) |
Returns the name of a type code member identified by the given index. | |
System::UInt32 | find_member_by_name (System::String^ name) |
Get the index of the member of the given name. | |
DDS::TypeCode^ | member_type (System::UInt32 index) |
Retrieves the DDS::TypeCode object describing the type of the member identified by the given index. | |
System::UInt32 | member_label_count (System::UInt32 index) |
Returns the number of labels associated to the index-th union member. | |
System::Int32 | member_label (System::UInt32 member_index, System::UInt32 label_index) |
Return the label_index-th label associated to the member_index-th member. | |
System::Int32 | member_ordinal (System::UInt32 index) |
Returns the ordinal that corresponds to the index-th enum value. | |
System::Boolean | is_member_key (System::UInt32 index) |
Function that tells if a member is a key or not. | |
System::Boolean | is_member_required (System::UInt32 index) |
Indicates whether a given member of a type is required to be present in every sample of that type. | |
System::Boolean | is_member_pointer (System::UInt32 index) |
Function that tells if a member is a pointer or not. | |
System::Boolean | is_member_bitfield (System::UInt32 index) |
Function that tells if a member is a bitfield or not. | |
System::Int16 | member_bitfield_bits (System::UInt32 index) |
Returns the number of bits of a bitfield member. | |
Visibility | member_visibility (System::UInt32 index) |
Returns the constant that indicates the visibility of the index-th member. | |
TypeCode^ | discriminator_type () |
Returns the discriminator type code. | |
System::UInt32 | length () |
Returns the number of elements in the type described by this type code. | |
System::UInt32 | array_dimension_count () |
This function returns the number of dimensions of an array type code. | |
System::UInt32 | array_dimension (System::UInt32 index) |
This function returns the index-th dimension of an array type code. | |
System::UInt32 | element_count () |
The number of elements in an array. | |
DDS::TypeCode^ | content_type () |
Returns the DDS::TypeCode object representing the type for the members of the object described by this DDS::TypeCode object. | |
System::Boolean | is_alias_pointer () |
Function that tells if an alias is a pointer or not. | |
System::Int32 | default_index () |
Returns the index of the default member, or -1 if there is no default member. | |
DDS::TypeCode^ | concrete_base_type () |
Returns the DDS::TypeCode that describes the concrete base type of the value type that this DDS::TypeCode object describes. | |
ValueModifier | type_modifier () |
Returns a constant indicating the modifier of the value type that this DDS::TypeCode object describes. | |
System::Int32 | member_id (System::UInt32 index) |
Returns the ID of a sparse type code member identified by the given index. | |
System::UInt32 | find_member_by_id (System::Int32 id) |
Get the index of the member of the given ID. | |
System::UInt32 | add_member_to_enum (System::String^ name, System::Int32 ordinal) |
Add a new enumerated constant to this enum DDS::TypeCode. | |
System::UInt32 | add_member (System::String^ name, System::Int32 id, DDS::TypeCode^ tc, System::Byte member_flags) |
Add a new member to this DDS::TypeCode. | |
System::UInt32 | add_member_ex (System::String^ name, System::Int32 id, DDS::TypeCode^ tc, System::Byte member_flags, Visibility visibility, System::Boolean is_pointer, System::Int16 bits) |
Add a new member to this DDS::TypeCode. | |
void | print_IDL (System::UInt32 indent) |
Prints a DDS::TypeCode in a pseudo-IDL notation. | |
Public Attributes | |
TypeCode^ | TC_NULL |
Basic null type. | |
TypeCode^ | TC_NULL |
Basic 16-bit signed integer type. | |
TypeCode^ | TC_LONG |
Basic 32-bit signed integer type. | |
TypeCode^ | TC_USHORT |
Basic unsigned 16-bit integer type. | |
TypeCode^ | TC_ULONG |
Basic unsigned 32-bit integer type. | |
TypeCode^ | TC_FLOAT |
Basic 32-bit floating point type. | |
TypeCode^ | TC_DOUBLE |
Basic 64-bit floating point type. | |
TypeCode^ | TC_BOOLEAN |
Basic Boolean type. | |
TypeCode^ | TC_CHAR |
Basic single-byte character type. | |
TypeCode^ | TC_OCTET |
Basic octet/byte type. | |
TypeCode^ | TC_LONGLONG |
Basic 64-bit integer type. | |
TypeCode^ | TC_ULONGLONG |
Basic unsigned 64-bit integer type. | |
TypeCode^ | TC_LONGDOUBLE |
Basic 128-bit floating point type. | |
TypeCode^ | TC_WCHAR |
Basic four-byte character type. | |
System::Int32 | MEMBER_ID_INVALID |
A sentinel indicating an invalid DDS::TypeCode member ID. | |
System::UInt32 | INDEX_INVALID |
A sentinel indicating an invalid DDS::TypeCode member index. | |
System::Int16 | NOT_BITFIELD |
Indicates that a member of a type is not a bitfield. | |
System::Byte | NONKEY_MEMBER |
A flag indicating that a type member is optional and not part of the key. | |
System::Byte | KEY_MEMBER |
A flag indicating that a type member is part of the key for that type, and therefore required. | |
System::Byte | NONKEY_REQUIRED_MEMBER |
A flag indicating that a type member is not part of the key but is nevertheless required. |
You create DDS::TypeCode objects using the DDS::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.
TCKind DDS::TypeCode::kind | ( | ) |
Gets the DDS::TCKind value of a type code.
Retrieves the kind of this DDS::TypeCode object. The kind of a type code determines which DDS::TypeCode methods may legally be invoked on it.
System::Boolean DDS::TypeCode::equal | ( | TypeCode^ | tc | ) |
Compares two DDS::TypeCode objects for equality.
tc | <<in>> Type code that will be compared with this DDS::TypeCode. |
DDS::ExceptionCode_t::BAD_PARAM_SYSTEM_EXCEPTION_CODE | if tc is null. |
System::String ^ DDS::TypeCode::name | ( | ) |
Retrieves the simple name identifying this DDS::TypeCode object within its enclosing scope.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::UInt32 DDS::TypeCode::member_count | ( | ) |
Returns the number of members of the type code.
The method member_count can be invoked on structure, union, and enumeration DDS::TypeCode objects.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::String ^ DDS::TypeCode::member_name | ( | System::UInt32 | index | ) |
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 DDS::TypeCode objects.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::UInt32 DDS::TypeCode::find_member_by_name | ( | System::String^ | name | ) |
Get the index of the member of the given name.
DDS::TypeCode ^ DDS::TypeCode::member_type | ( | System::UInt32 | index | ) |
Retrieves the DDS::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.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::UInt32 DDS::TypeCode::member_label_count | ( | System::UInt32 | index | ) |
Returns the number of labels associated to the index-th union member.
The method can be invoked on union DDS::TypeCode objects.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::Int32 DDS::TypeCode::member_label | ( | System::UInt32 | member_index, | |
System::UInt32 | label_index | |||
) |
Return the label_index-th label associated to the member_index-th member.
This method has been modified for RTI Data Distribution Service 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 DDS::TypeCode objects.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::Int32 DDS::TypeCode::member_ordinal | ( | System::UInt32 | index | ) |
Returns the ordinal that corresponds to the index-th enum value.
The method can be invoked on enum DDS::TypeCode objects.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::Boolean DDS::TypeCode::is_member_key | ( | System::UInt32 | index | ) |
Function that tells if a member is a key or not.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::Boolean DDS::TypeCode::is_member_required | ( | System::UInt32 | index | ) |
Indicates whether a given member of a type is required to be present in every sample of that type.
Which fields are required depends on the DDS::TCKind of the type. For example, in a type of kind DDS::TCKind::TK_SPARSE, key fields are required. In DDS::TCKind::TK_STRUCT and DDS::TCKind::TK_VALUE types, all fields are required.
System::Boolean DDS::TypeCode::is_member_pointer | ( | System::UInt32 | index | ) |
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 Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Index of the member for which type information is begin requested. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::Boolean DDS::TypeCode::is_member_bitfield | ( | System::UInt32 | index | ) |
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 Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::Int16 DDS::TypeCode::member_bitfield_bits | ( | System::UInt32 | index | ) |
Returns the number of bits of a bitfield member.
The method can be invoked on struct type objects.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
Visibility DDS::TypeCode::member_visibility | ( | System::UInt32 | index | ) |
Returns the constant that indicates the visibility of the index-th member.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
TypeCode ^ DDS::TypeCode::discriminator_type | ( | ) |
Returns the discriminator type code.
The method discriminator_type can be invoked only on union DDS::TypeCode objects.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::UInt32 DDS::TypeCode::length | ( | ) |
Returns the number of elements in the type described by this type code.
Length is:
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::UInt32 DDS::TypeCode::array_dimension_count | ( | ) |
This function returns the number of dimensions of an array type code.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::UInt32 DDS::TypeCode::array_dimension | ( | System::UInt32 | index | ) |
This function returns the index-th dimension of an array type code.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Dimension index in the interval [0,(dimensions count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::UInt32 DDS::TypeCode::element_count | ( | ) |
The number of elements in an array.
This operation isn't relevant for other kinds of types.
DDS::TypeCode ^ DDS::TypeCode::content_type | ( | ) |
Returns the DDS::TypeCode object representing the type for the members of the object described by this DDS::TypeCode object.
For sequences and arrays, it returns the element type. For aliases, it returns the original type.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::Boolean DDS::TypeCode::is_alias_pointer | ( | ) |
Function that tells if an alias is a pointer or not.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::Int32 DDS::TypeCode::default_index | ( | ) |
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 DDS::TypeCode objects.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
DDS::TypeCode ^ DDS::TypeCode::concrete_base_type | ( | ) |
Returns the DDS::TypeCode that describes the concrete base type of the value type that this DDS::TypeCode object describes.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
ValueModifier DDS::TypeCode::type_modifier | ( | ) |
Returns a constant indicating the modifier of the value type that this DDS::TypeCode object describes.
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. |
System::Int32 DDS::TypeCode::member_id | ( | System::UInt32 | index | ) |
Returns the ID of a sparse type code member identified by the given index.
The method can be invoked on sparse DDS::TypeCode objects.
This function is an RTI Data Distribution Service extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. |
DDS::ExceptionCode_t::BADKIND_USER_EXCEPTION_CODE | if the method is invoked on an inappropriate kind of TypeCode object. | |
DDS::ExceptionCode_t::BOUNDS_USER_EXCEPTION_CODE | - if the index parameter/s are out of range. |
System::UInt32 DDS::TypeCode::find_member_by_id | ( | System::Int32 | id | ) |
Get the index of the member of the given ID.
System::UInt32 DDS::TypeCode::add_member_to_enum | ( | System::String^ | name, | |
System::Int32 | ordinal | |||
) |
Add a new enumerated constant to this enum DDS::TypeCode.
This method is applicable to DDS::TypeCode objects representing enumerations (DDS::TCKind::TK_ENUM). To add a field to a structured type, see DDS::TypeCode::add_member_to_enum.
Modifying a DDS::TypeCode -- such as by adding a member -- is important if you are using the Dynamic Data APIs.
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. |
System::UInt32 DDS::TypeCode::add_member | ( | System::String^ | name, | |
System::Int32 | id, | |||
DDS::TypeCode^ | tc, | |||
System::Byte | member_flags | |||
) |
Add a new member to this DDS::TypeCode.
This method is applicable to DDS::TypeCode objects representing structures (DDS::TCKind::TK_STRUCT), value types (DDS::TCKind::TK_VALUE), sparse value types (DDS::TCKind::TK_SPARSE), and unions (DDS::TCKind::TK_UNION). To add a constant to an enumeration, see DDS::TypeCode::add_member_to_enum.
Modifying a DDS::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.
In C#:
// Integer: myTypeCode.add_member( "myFieldName", // If the type is sparse, specify an ID. Otherwise, use this sentinel: TypeCode.MEMBER_ID_INVALID, TypeCodeFactory.get_instance().get_primitive_tc(TCKind.TK_LONG), // New field is not a key: TypeCode.NONKEY_REQUIRED_MEMBER); // Sequence of 10 or fewer integers: myTypeCode.add_member( "myFieldName", // If the type is sparse, specify an ID. Otherwise, use this sentinel: TypeCode.MEMBER_ID_INVALID, TypeCodeFactory.get_instance().create_sequence_tc( 10, TypeCodeFactory.get_instance().get_primitive_tc(TCKind.TK_LONG)), // New field is not a key: TypeCode.NONKEY_REQUIRED_MEMBER);
In C++/CLI:
// Integer: myTypeCode->add_member( "myFieldName", // If the type is sparse, specify an ID. Otherwise, use this sentinel: TypeCode::MEMBER_ID_INVALID, TypeCodeFactory::get_instance()->get_primitive_tc(TCKind::TK_LONG), // New field is not a key: TypeCode::NONKEY_REQUIRED_MEMBER); // Sequence of 10 or fewer integers: myTypeCode->add_member( "myFieldName", // If the type is sparse, specify an ID. Otherwise, use this sentinel: TypeCode::MEMBER_ID_INVALID, TypeCodeFactory::get_instance()->create_sequence_tc( 10, TypeCodeFactory::get_instance()->get_primitive_tc(TCKind::TK_LONG)), // New field is not a key: TypeCode::NONKEY_REQUIRED_MEMBER);
name | <<in>> The name of the new member. | |
id | <<in>> The ID of the new member. This should only be specified for members of kind DDS::TCKind::TK_SPARSE and DDS::TCKind::TK_UNION; otherwise, it should be DDS::TypeCode::MEMBER_ID_INVALID. | |
tc | <<in>> The type of the new member. You can get or create this DDS::TypeCode with the DDS::TypeCodeFactory. | |
member_flags | <<in>> Indicates whether the member is part of the key and whether it is required. |
System::UInt32 DDS::TypeCode::add_member_ex | ( | System::String^ | name, | |
System::Int32 | id, | |||
DDS::TypeCode^ | tc, | |||
System::Byte | member_flags, | |||
Visibility | visibility, | |||
System::Boolean | is_pointer, | |||
System::Int16 | bits | |||
) |
Add a new member to this DDS::TypeCode.
Modifying a DDS::TypeCode -- such as by adding a member -- is important if you are using the Dynamic Data APIs.
name | <<in>> The name of the new member. | |
id | <<in>> The ID of the new member. This should only be specified for members of kind DDS::TCKind::TK_SPARSE and DDS::TCKind::TK_UNION; otherwise, it should be DDS::TypeCode::MEMBER_ID_INVALID. | |
tc | <<in>> The type of the new member. You can get or create this DDS::TypeCode with the DDS::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 DDS::TCKind::TK_VALUE and DDS::TCKind::TK_SPARSE. | |
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 DDS::TypeCode::NOT_BITFIELD. |
void DDS::TypeCode::print_IDL | ( | System::UInt32 | indent | ) |