Public Member Functions | |
DDS_TCKind | kind (DDS_ExceptionCode_t &ex) const |
Gets the DDS_TCKind value of a type code. | |
DDS_Boolean | equal (const DDS_TypeCode *tc, DDS_ExceptionCode_t &ex) const |
Compares two DDS_TypeCode objects for equality. | |
const char * | name (DDS_ExceptionCode_t &ex) const |
Retrieves the simple name identifying this DDS_TypeCode object within its enclosing scope. | |
DDS_UnsignedLong | member_count (DDS_ExceptionCode_t &ex) const |
Returns the number of members of the type code. | |
const char * | member_name (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the name of a type code member identified by the given index. | |
DDS_UnsignedLong | find_member_by_name (const char *name, DDS_ExceptionCode_t &ex) const |
Get the index of the member of the given name. | |
DDS_TypeCode * | member_type (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Retrieves the DDS_TypeCode object describing the type of the member identified by the given index. | |
DDS_UnsignedLong | member_label_count (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the number of labels associated to the index-th union member. | |
DDS_Long | member_label (DDS_UnsignedLong member_index, DDS_UnsignedLong label_index, DDS_ExceptionCode_t &ex) const |
Return the label_index-th label associated to the member_index-th member. | |
DDS_Long | member_ordinal (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the ordinal that corresponds to the index-th enum value. | |
DDS_Boolean | is_member_key (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Function that tells if a member is a key or not. | |
DDS_Boolean | is_member_required (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Indicates whether a given member of a type is required to be present in every sample of that type. | |
DDS_Boolean | is_member_pointer (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Function that tells if a member is a pointer or not. | |
DDS_Boolean | is_member_bitfield (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Function that tells if a member is a bitfield or not. | |
DDS_Short | member_bitfield_bits (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the number of bits of a bitfield member. | |
DDS_Visibility | member_visibility (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the constant that indicates the visibility of the index-th member. | |
DDS_TypeCode * | discriminator_type (DDS_ExceptionCode_t &ex) const |
Returns the discriminator type code. | |
DDS_UnsignedLong | length (DDS_ExceptionCode_t &ex) const |
Returns the number of elements in the type described by this type code. | |
DDS_UnsignedLong | array_dimension_count (DDS_ExceptionCode_t &ex) const |
This function returns the number of dimensions of an array type code. | |
DDS_UnsignedLong | array_dimension (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
This function returns the index-th dimension of an array type code. | |
DDS_UnsignedLong | element_count (DDS_ExceptionCode_t &ex) const |
The number of elements in an array. | |
DDS_TypeCode * | content_type (DDS_ExceptionCode_t &ex) const |
Returns the DDS_TypeCode object representing the type for the members of the object described by this DDS_TypeCode object. | |
DDS_Boolean | is_alias_pointer (DDS_ExceptionCode_t &ex) const |
Function that tells if an alias is a pointer or not. | |
DDS_Long | default_index (DDS_ExceptionCode_t &ex) const |
Returns the index of the default member, or -1 if there is no default member. | |
DDS_TypeCode * | concrete_base_type (DDS_ExceptionCode_t &ex) const |
Returns the DDS_TypeCode that describes the concrete base type of the value type that this DDS_TypeCode object describes. | |
DDS_ValueModifier | type_modifier (DDS_ExceptionCode_t &ex) const |
Returns a constant indicating the modifier of the value type that this DDS_TypeCode object describes. | |
DDS_Long | member_id (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the ID of a sparse type code member identified by the given index. | |
DDS_UnsignedLong | find_member_by_id (DDS_Long id, DDS_ExceptionCode_t &ex) const |
Get the index of the member of the given ID. | |
DDS_UnsignedLong | add_member_to_enum (const char *name, DDS_Long ordinal, DDS_ExceptionCode_t &ex) |
Add a new enumerated constant to this enum DDS_TypeCode. | |
DDS_UnsignedLong | add_member (const char *name, DDS_Long id, const DDS_TypeCode *tc, DDS_Octet member_flags, DDS_ExceptionCode_t &ex) |
Add a new member to this DDS_TypeCode. | |
DDS_UnsignedLong | add_member_ex (const char *name, DDS_Long id, const DDS_TypeCode *tc, DDS_Octet member_flags, DDS_Visibility visibility, DDS_Boolean is_pointer, DDS_Short bits, DDS_ExceptionCode_t &ex) |
Add a new member to this DDS_TypeCode. | |
void | print_IDL (DDS_UnsignedLong indent, DDS_ExceptionCode_t &ex) const |
Prints a DDS_TypeCode in a pseudo-IDL notation. |
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.
DDS_TCKind DDS_TypeCode::kind | ( | DDS_ExceptionCode_t & | ex | ) | const |
Gets the DDS_TCKind value of a type code.
ex | <<out>> Parameter for error indications. The values that it can take are: |
DDS_Boolean DDS_TypeCode::equal | ( | const DDS_TypeCode * | tc, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Compares two DDS_TypeCode objects for equality.
tc | <<in>> Type code that will be compared with this DDS_TypeCode. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
const char* DDS_TypeCode::name | ( | DDS_ExceptionCode_t & | ex | ) | const |
Retrieves the simple name identifying this DDS_TypeCode object within its enclosing scope.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::member_count | ( | DDS_ExceptionCode_t & | ex | ) | const |
Returns the number of members of the type code.
The method member_count can be invoked on structure, union, and enumeration DDS_TypeCode objects.
ex | <<out>> Parameter for error indications. The values that can take are: |
const char* DDS_TypeCode::member_name | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::find_member_by_name | ( | const char * | name, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Get the index of the member of the given name.
DDS_TypeCode* DDS_TypeCode::member_type | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::member_label_count | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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 Connext extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Long DDS_TypeCode::member_label | ( | DDS_UnsignedLong | member_index, | |
DDS_UnsignedLong | label_index, | |||
DDS_ExceptionCode_t & | ex | |||
) | const |
Return the label_index-th label associated to the member_index-th member.
This method has been modified for RTI Connext 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.
member_index | <<in>> Member index. | |
label_index | <<in>> Label index. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Long DDS_TypeCode::member_ordinal | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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 Connext extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Boolean DDS_TypeCode::is_member_key | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Function that tells if a member is a key or not.
This function is an RTI Connext extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Boolean DDS_TypeCode::is_member_required | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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_TK_SPARSE, key fields are required. In DDS_TK_STRUCT and DDS_TK_VALUE types, all fields are required.
DDS_Boolean DDS_TypeCode::is_member_pointer | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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 Connext extension to the CORBA Type Code Specification.
index | <<in>> Index of the member for which type information is begin requested. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Boolean DDS_TypeCode::is_member_bitfield | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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 Connext extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Short DDS_TypeCode::member_bitfield_bits | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Returns the number of bits of a bitfield member.
The method can be invoked on struct type objects.
This function is an RTI Connext extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Visibility DDS_TypeCode::member_visibility | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Returns the constant that indicates the visibility of the index-th member.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCode::discriminator_type | ( | DDS_ExceptionCode_t & | ex | ) | const |
Returns the discriminator type code.
The method discriminator_type can be invoked only on union DDS_TypeCode objects.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::length | ( | DDS_ExceptionCode_t & | ex | ) | const |
Returns the number of elements in the type described by this type code.
Length is:
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::array_dimension_count | ( | DDS_ExceptionCode_t & | ex | ) | const |
This function returns the number of dimensions of an array type code.
This function is an RTI Connext extension to the CORBA Type Code Specification.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::array_dimension | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
This function returns the index-th dimension of an array type code.
This function is an RTI Connext extension to the CORBA Type Code Specification.
index | <<in>> Dimension index in the interval [0,(dimensions count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::element_count | ( | DDS_ExceptionCode_t & | ex | ) | const |
The number of elements in an array.
This operation isn't relevant for other kinds of types.
DDS_TypeCode* DDS_TypeCode::content_type | ( | DDS_ExceptionCode_t & | ex | ) | const |
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.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Boolean DDS_TypeCode::is_alias_pointer | ( | DDS_ExceptionCode_t & | ex | ) | const |
Function that tells if an alias is a pointer or not.
This function is an RTI Connext extension to the CORBA Type Code Specification.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Long DDS_TypeCode::default_index | ( | DDS_ExceptionCode_t & | ex | ) | const |
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.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCode::concrete_base_type | ( | DDS_ExceptionCode_t & | ex | ) | const |
Returns the DDS_TypeCode that describes the concrete base type of the value type that this DDS_TypeCode object describes.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_ValueModifier DDS_TypeCode::type_modifier | ( | DDS_ExceptionCode_t & | ex | ) | const |
Returns a constant indicating the modifier of the value type that this DDS_TypeCode object describes.
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Long DDS_TypeCode::member_id | ( | DDS_UnsignedLong | index, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
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 Connext extension to the CORBA Type Code Specification.
index | <<in>> Member index in the interval [0,(member count-1)]. | |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::find_member_by_id | ( | DDS_Long | id, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Get the index of the member of the given ID.
DDS_UnsignedLong DDS_TypeCode::add_member_to_enum | ( | const char * | name, | |
DDS_Long | ordinal, | |||
DDS_ExceptionCode_t & | ex | |||
) |
Add a new enumerated constant to this enum DDS_TypeCode.
This method is applicable to DDS_TypeCode objects representing enumerations (DDS_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. | |
ex | <<out>> If this method fails, this argument will contain information about the failure. Possible values include: |
DDS_UnsignedLong DDS_TypeCode::add_member | ( | const char * | name, | |
DDS_Long | id, | |||
const DDS_TypeCode * | tc, | |||
DDS_Octet | member_flags, | |||
DDS_ExceptionCode_t & | ex | |||
) |
Add a new member to this DDS_TypeCode.
This method is applicable to DDS_TypeCode objects representing structures (DDS_TK_STRUCT), value types (DDS_TK_VALUE), sparse value types (DDS_TK_SPARSE), and unions (DDS_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.
// Integer: myTypeCode->add_member( "myFieldName", // If the type is sparse, specify an ID. Otherwise, use this sentinel: DDS_TYPECODE_MEMBER_ID_INVALID, DDS_TheTypeCodeFactory->get_primitive_tc(DDS_TK_LONG), // New field is not a key: DDS_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: DDS_TYPECODE_MEMBER_ID_INVALID, DDS_TheTypeCodeFactory->create_sequence_tc( 10, DDS_TheTypeCodeFactory->get_primitive_tc(DDS_TK_LONG)), // New field is not a key: DDS_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_TK_SPARSE and DDS_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. | |
ex | <<out>> If this method fails, this argument will contain information about the failure. Possible values include: |
DDS_UnsignedLong DDS_TypeCode::add_member_ex | ( | const char * | name, | |
DDS_Long | id, | |||
const DDS_TypeCode * | tc, | |||
DDS_Octet | member_flags, | |||
DDS_Visibility | visibility, | |||
DDS_Boolean | is_pointer, | |||
DDS_Short | bits, | |||
DDS_ExceptionCode_t & | ex | |||
) |
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_TK_SPARSE and DDS_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_TK_VALUE and DDS_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. | |
ex | <<out>> If this method fails, this argument will contain information about the failure. Possible values include: |
void DDS_TypeCode::print_IDL | ( | DDS_UnsignedLong | indent, | |
DDS_ExceptionCode_t & | ex | |||
) | const |
Prints a DDS_TypeCode in a pseudo-IDL notation.