RTI Connext C API
Version 5.1.0
|
<<eXtension>> A DDS_TypeCode is a mechanism for representing a type at runtime. RTI Connext can use type codes to send type definitions on the network. You will need to understand this API in order to use the Dynamic Data capability or to inspect the type information you receive from remote readers and writers. More...
Data Structures | |
struct | DDS_TypeCode |
The definition of a particular data type, which you can use to inspect the name, members, and other properties of types generated with rtiddsgen or to modify types you define yourself at runtime. More... | |
struct | DDS_StructMember |
A description of a member of a struct. More... | |
struct | DDS_StructMemberSeq |
Defines a sequence of struct members. More... | |
struct | DDS_UnionMember |
A description of a member of a union. More... | |
struct | DDS_UnionMemberSeq |
Defines a sequence of union members. More... | |
struct | DDS_EnumMember |
A description of a member of an enumeration. More... | |
struct | DDS_EnumMemberSeq |
Defines a sequence of enumerator members. More... | |
struct | DDS_ValueMember |
A description of a member of a value type. More... | |
struct | DDS_ValueMemberSeq |
Defines a sequence of value members. More... | |
struct | DDS_TypeCodeFactory |
A singleton factory for creating, copying, and deleting data type definitions dynamically. More... | |
Macros | |
#define | DDS_TYPECODE_MEMBER_ID_INVALID |
A sentinel indicating an invalid DDS_TypeCode member ID. | |
#define | DDS_TYPECODE_INDEX_INVALID |
A sentinel indicating an invalid DDS_TypeCode member index. | |
#define | DDS_TYPECODE_NOT_BITFIELD |
Indicates that a member of a type is not a bitfield. | |
#define | DDS_VM_NONE |
Constant used to indicate that a value type has no modifiers. | |
#define | DDS_VM_CUSTOM |
Constant used to indicate that a value type has the custom modifier. | |
#define | DDS_VM_ABSTRACT |
Constant used to indicate that a value type has the abstract modifier. | |
#define | DDS_VM_TRUNCATABLE |
Constant used to indicate that a value type has the truncatable modifier. | |
#define | DDS_PRIVATE_MEMBER |
Constant used to indicate that a value type member is private. | |
#define | DDS_PUBLIC_MEMBER |
Constant used to indicate that a value type member is public. | |
#define | DDS_TYPECODE_NONKEY_MEMBER |
A flag indicating that a type member is optional and not part of the key. | |
#define | DDS_TYPECODE_KEY_MEMBER |
A flag indicating that a type member is part of the key for that type, and therefore required. | |
#define | DDS_TYPECODE_NONKEY_REQUIRED_MEMBER |
A flag indicating that a type member is not part of the key but is nevertheless required. | |
Typedefs | |
typedef short | DDS_ValueModifier |
Modifier type for a value type. | |
typedef short | DDS_Visibility |
Type to indicate the visibility of a value type member. | |
Enumerations | |
enum | DDS_TCKind { DDS_TK_NULL, DDS_TK_SHORT, DDS_TK_LONG, DDS_TK_USHORT, DDS_TK_ULONG, DDS_TK_FLOAT, DDS_TK_DOUBLE, DDS_TK_BOOLEAN, DDS_TK_CHAR, DDS_TK_OCTET, DDS_TK_STRUCT, DDS_TK_UNION, DDS_TK_ENUM, DDS_TK_STRING, DDS_TK_SEQUENCE, DDS_TK_ARRAY, DDS_TK_ALIAS, DDS_TK_LONGLONG, DDS_TK_ULONGLONG, DDS_TK_LONGDOUBLE, DDS_TK_WCHAR, DDS_TK_WSTRING, DDS_TK_VALUE, DDS_TK_SPARSE } |
Enumeration type for DDS_TypeCode kinds. More... | |
enum | DDS_ExtensibilityKind { DDS_FINAL_EXTENSIBILITY, DDS_EXTENSIBLE_EXTENSIBILITY, DDS_MUTABLE_EXTENSIBILITY } |
Type to indicate the extensibility of a type. More... | |
Variables | |
DDS_TypeCode | DDS_g_tc_null |
Basic NULL type. | |
DDS_TypeCode | DDS_g_tc_short |
Basic 16-bit signed integer type. | |
DDS_TypeCode | DDS_g_tc_long |
Basic 32-bit signed integer type. | |
DDS_TypeCode | DDS_g_tc_ushort |
Basic unsigned 16-bit integer type. | |
DDS_TypeCode | DDS_g_tc_ulong |
Basic unsigned 32-bit integer type. | |
DDS_TypeCode | DDS_g_tc_float |
Basic 32-bit floating point type. | |
DDS_TypeCode | DDS_g_tc_double |
Basic 64-bit floating point type. | |
DDS_TypeCode | DDS_g_tc_boolean |
Basic Boolean type. | |
DDS_TypeCode | DDS_g_tc_char |
Basic single-byte character type. | |
DDS_TypeCode | DDS_g_tc_octet |
Basic octet/byte type. | |
DDS_TypeCode | DDS_g_tc_longlong |
Basic 64-bit integer type. | |
DDS_TypeCode | DDS_g_tc_ulonglong |
Basic unsigned 64-bit integer type. | |
DDS_TypeCode | DDS_g_tc_longdouble |
Basic 128-bit floating point type. | |
DDS_TypeCode | DDS_g_tc_wchar |
Basic four-byte character type. | |
<<eXtension>> A DDS_TypeCode is a mechanism for representing a type at runtime. RTI Connext can use type codes to send type definitions on the network. You will need to understand this API in order to use the Dynamic Data capability or to inspect the type information you receive from remote readers and writers.
Type codes are values that are used to describe arbitrarily complex types at runtime. Type code values are manipulated via the DDS_TypeCode class, which has an analogue in CORBA.
A DDS_TypeCode value consists of a type code kind (represented by the DDS_TCKind enumeration) and a list of members (that is, fields). These members are recursive: each one has its own DDS_TypeCode, and in the case of complex types (structures, arrays, and so on), these contained type codes contain their own members.
There are a number of uses for type codes. The type code mechanism can be used to unambiguously match type representations. The DDS_TypeCode_equal function is a more reliable test than comparing the string type names, requiring equivalent definitions of the types.
When generating types with rtiddsgen, type codes are enabled by default. (The -notypecode option can be used to disable generation of DDS_TypeCode information.) For these types, a DDS_TypeCode may be accessed by calling the Foo_get_typecode
function for a type "Foo", which returns a DDS_TypeCode pointer.
This API also includes support for dynamic creation of DDS_TypeCode values, typically for use with the Dynamic Data API. You can create a DDS_TypeCode using the DDS_TypeCodeFactory class. You will construct the DDS_TypeCode recursively, from the outside in: start with the type codes for primitive types, then compose them into complex types like arrays, structures, and so on. You will find the following methods helpful:
In addition to being used locally, RTI Connext can transmit DDS_TypeCode on the network between participants. This information can be used to access information about types used remotely at runtime, for example to be able to publish or subscribe to topics of arbitrarily types (see Dynamic Data). This functionality is useful for a generic system monitoring tool like rtiddsspy
.
Remote DDS_TypeCode information is shared during discovery over the publication and subscription built-in topics and can be accessed using the built-in readers for these topics; see Built-in Topics. Discovered DDS_TypeCode values are not cached by RTI Connext upon receipt and are therefore not available from the built-in topic data returned by DDS_DataWriter_get_matched_subscription_data or DDS_DataReader_get_matched_publication_data.
The space available locally to deserialize a discovered remote DDS_TypeCode is specified by the DDS_DomainParticipant's DDS_DomainParticipantResourceLimitsQosPolicy::type_code_max_serialized_length QoS parameter. To support especially complex type codes, it may be necessary for you to increase the value of this parameter.
#define DDS_TYPECODE_MEMBER_ID_INVALID |
A sentinel indicating an invalid DDS_TypeCode member ID.
#define DDS_TYPECODE_INDEX_INVALID |
A sentinel indicating an invalid DDS_TypeCode member index.
#define DDS_TYPECODE_NOT_BITFIELD |
Indicates that a member of a type is not a bitfield.
#define DDS_VM_NONE |
Constant used to indicate that a value type has no modifiers.
#define DDS_VM_CUSTOM |
Constant used to indicate that a value type has the custom
modifier.
This modifier is used to specify whether the value type uses custom marshaling.
#define DDS_VM_ABSTRACT |
Constant used to indicate that a value type has the abstract
modifier.
An abstract value type may not be instantiated.
#define DDS_VM_TRUNCATABLE |
Constant used to indicate that a value type has the truncatable
modifier.
A value with a state that derives from another value with a state can be declared as truncatable. A truncatable type means the object can be truncated to the base type.
#define DDS_PRIVATE_MEMBER |
Constant used to indicate that a value type member is private.
#define DDS_PUBLIC_MEMBER |
Constant used to indicate that a value type member is public.
#define DDS_TYPECODE_NONKEY_MEMBER |
A flag indicating that a type member is optional and not part of the key.
Only sparse value types (i.e. types of DDS_TCKind DDS_TK_SPARSE) support this flag. Non-key members of other type kinds should use the flag DDS_TYPECODE_NONKEY_REQUIRED_MEMBER.
If a type is used with the Dynamic Data facility, a DDS_DynamicData sample of the type will only contain a value for a DDS_TYPECODE_NONKEY_MEMBER field if one has been explicitly set (see, for example, DDS_DynamicData_set_long). The middleware will not assume any default value.
#define DDS_TYPECODE_KEY_MEMBER |
A flag indicating that a type member is part of the key for that type, and therefore required.
If a type is used with the Dynamic Data facility, all DDS_DynamicData samples of the type will contain a value for all DDS_TYPECODE_KEY_MEMBER fields, even if the type is a sparse value type (i.e. of kind DDS_TK_SPARSE). If you do not set a value of the member explicitly (see, for example, DDS_DynamicData_set_long), the middleware will assume a default "zero" value: numeric values will be set to zero; strings and sequences will be of zero length.
#define DDS_TYPECODE_NONKEY_REQUIRED_MEMBER |
A flag indicating that a type member is not part of the key but is nevertheless required.
This is the most common kind of member.
If a type is used with the Dynamic Data facility, all DDS_DynamicData samples of the type will contain a value for all DDS_TYPECODE_NONKEY_REQUIRED_MEMBER fields, even if the type is a sparse value type (i.e. of kind DDS_TK_SPARSE). If you do not set a value of the member explicitly (see, for example, DDS_DynamicData_set_long), the middleware will assume a default "zero" value: numeric values will be set to zero; strings and sequences will be of zero length.
typedef short DDS_ValueModifier |
Modifier type for a value type.
typedef short DDS_Visibility |
Type to indicate the visibility of a value type member.
enum DDS_TCKind |
Enumeration type for DDS_TypeCode kinds.
Type code kinds are modeled as values of this type.
DDS_TK_NULL |
Indicates that a type code does not describe anything. |
DDS_TK_SHORT |
short type. |
DDS_TK_LONG |
long type. |
DDS_TK_USHORT |
unsigned short type. |
DDS_TK_ULONG |
unsigned long type. |
DDS_TK_FLOAT |
float type. |
DDS_TK_DOUBLE |
double type. |
DDS_TK_BOOLEAN |
boolean type. |
DDS_TK_CHAR |
char type. |
DDS_TK_OCTET |
octet type. |
DDS_TK_STRUCT |
struct type. |
DDS_TK_UNION |
union type. |
DDS_TK_ENUM |
enumerated type. |
DDS_TK_STRING |
string type. |
DDS_TK_SEQUENCE |
sequence type. |
DDS_TK_ARRAY |
array type. |
DDS_TK_ALIAS |
alias (typedef) type. |
DDS_TK_LONGLONG |
long long type. |
DDS_TK_ULONGLONG |
unsigned long long type. |
DDS_TK_LONGDOUBLE |
long double type. |
DDS_TK_WCHAR |
wide char type. |
DDS_TK_WSTRING |
wide string type. |
DDS_TK_VALUE |
value type. |
DDS_TK_SPARSE |
A sparse value type. A sparse value type is one in which all of the fields are not necessarily sent on the network as a part of every sample. Fields of a sparse value type fall into one of three categories:
Fields of the first two kinds must appear in every sample. These are also the only kinds of fields on which you can perform content filtering (see DDS_ContentFilteredTopic), because filter evaluation on a non-existent field is not well defined. |
Type to indicate the extensibility of a type.
DDS_FINAL_EXTENSIBILITY |
Specifies that a type has FINAL extensibility. A type may be final, indicating that the range of its possible values is strictly defined. In particular, it is not possible to add elements to members of collection or aggregated types while maintaining type assignability. The following types are always final:
|
DDS_EXTENSIBLE_EXTENSIBILITY |
Specifies that a type has EXTENSIBLE extensibility. A type may be extensible, indicating that two types, where one contains all of the elements/members of the other plus additional elements/members appended to the end, may remain assignable. |
DDS_MUTABLE_EXTENSIBILITY |
Specifies that a type has MUTABLE extensibility. [Not supported.] A type may be mutable, indicating that two types may differ from one another in the additional, removal, and/or transposition of elements/members while remaining assignable. The following types are always mutable: The support for type mutability in this release is limited to DDS_TK_SEQUENCE, DDS_TK_STRING, and DDS_TK_WSTRING. Mutability in DDS_TK_STRUCT, DDS_TK_UNION, DDS_TK_VALUE, and DDS_TK_ENUM is not supported. |
DDS_TCKind DDS_TypeCode_kind | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Gets the DDS_TCKind value of a type code.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that it can take are: |
Retrieves the kind of this DDS_TypeCode object. The kind of a type code determines which DDS_TypeCode functions may legally be invoked on it.
DDS_ExtensibilityKind DDS_TypeCode_extensibility_kind | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Gets the DDS_ExtensibilityKind value of a type code.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that it can take are: |
Retrieves the extensibility kind of this DDS_TypeCode object.
In some cases, it is desirable for types to evolve without breaking interoperability with deployed components already using those types. For example:
A new set of applications to be integrated into an existing system may want to introduce additional fields into a structure. These new fields can be safely ignored by already deployed applications, but applications that do understand the new fields can benefit from their presence.
In order to support use cases such as these, the type system introduces the concept of extensible and mutable types.
A type may be final, indicating that the range of its possible data values is strictly defined. In particular, it is not possible to add elements to members of collection or aggregated types while maintaining type assignability.
A type may be extensible, indicating that two types, where one contains all of the elements/members of the other plus additional elements/members appended to the end, may remain assignable.
The extensibility of DDS_TK_STRUCT, DDS_TK_UNION, DDS_TK_VALUE, and DDS_TK_ENUM can be change using the built-in "Extensibility" annotation when the type is declared.
IDL examples:
XML example:
XSD example:
For TypeCodes built at run-time using the DDS_TypeCodeFactory API, the extensibility can be provided as a parameter of the following APIs:
DDS_Boolean DDS_TypeCode_equal | ( | const DDS_TypeCode * | self, |
const DDS_TypeCode * | tc, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Compares two DDS_TypeCode objects for equality.
For equality and assignability purposes, DDS_TK_STRUCT and DDS_TK_VALUE are considered equivalent.
The DDS_TypeCode of structs inheriting from other structs has a DDS_TK_VALUE kind.
For example:
The code generation for the previous type will generate a DDS_TypeCode with DDS_TK_VALUE kind.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Retrieves the simple name identifying this DDS_TypeCode object within its enclosing scope.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode_member_count | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Returns the number of members of the type code.
The function member_count can be invoked on structure, union, and enumeration DDS_TypeCode objects.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
const char* DDS_TypeCode_member_name | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Returns the name of a type code member identified by the given index.
The function member_name can be invoked on structure, union, and enumeration DDS_TypeCode objects.
self | <<in>> Cannot be NULL. |
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 DDS_TypeCode * | self, |
const char * | name, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Get the index of the member of the given name.
DDS_TypeCode* DDS_TypeCode_member_type | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Retrieves the DDS_TypeCode object describing the type of the member identified by the given index.
The function member_type can be invoked on structure and union type codes.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Returns the number of labels associated to the index-th union member.
The function can be invoked on union DDS_TypeCode objects.
This function is an RTI Connext extension to the CORBA Type Code Specification.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | member_index, | ||
DDS_UnsignedLong | label_index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Return the label_index-th label associated to the member_index-th member.
This function 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 function can be invoked on union DDS_TypeCode objects.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Returns the ordinal that corresponds to the index-th enum value.
The function can be invoked on enum DDS_TypeCode objects.
This function is an RTI Connext extension to the CORBA Type Code Specification.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Function that tells if a member is a key or not.
This function is an RTI Connext extension to the CORBA Type Code Specification.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Function that tells if a member is a pointer or not.
The function 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.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Function that tells if a member is a bitfield or not.
The function can be invoked on struct type objects.
This function is an RTI Connext extension to the CORBA Type Code Specification.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Returns the number of bits of a bitfield member.
The function can be invoked on struct type objects.
This function is an RTI Connext extension to the CORBA Type Code Specification.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Returns the constant that indicates the visibility of the index-th member.
For DDS_TK_STRUCT, this function always returns DDS_PUBLIC_MEMBER.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Returns the discriminator type code.
The function discriminator_type can be invoked only on union DDS_TypeCode objects.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode_length | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Returns the number of elements in the type described by this type code.
Length is:
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode_array_dimension_count | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
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.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode_array_dimension | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
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.
self | <<in>> Cannot be NULL. |
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 | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
The number of elements in an array.
This operation isn't relevant for other kinds of types.
DDS_TypeCode* DDS_TypeCode_content_type | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
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.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Boolean DDS_TypeCode_is_alias_pointer | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Function that tells if an alias is a pointer or not.
This function is an RTI Connext extension to the CORBA Type Code Specification.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_Long DDS_TypeCode_default_index | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Returns the index of the default member, or -1 if there is no default member.
The function default_index can be invoked only on union DDS_TypeCode objects.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCode_concrete_base_type | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Returns the DDS_TypeCode that describes the concrete base type of the value type that this DDS_TypeCode object describes.
For DDS_TK_STRUCT, this function always returns DDS_TK_NULL.
The DDS_TypeCode of structs inheriting from other structs has a DDS_TK_VALUE kind.
For example:
The code generation for the previous type will generate a DDS_TypeCode with DDS_TK_VALUE kind.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_ValueModifier DDS_TypeCode_type_modifier | ( | const DDS_TypeCode * | self, |
DDS_ExceptionCode_t * | ex | ||
) |
Returns a constant indicating the modifier of the value type that this DDS_TypeCode object describes.
For DDS_TK_STRUCT, this function always returns DDS_VM_NONE.
self | <<in>> Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode_find_member_by_id | ( | const DDS_TypeCode * | self, |
DDS_Long | id, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Get the index of the member of the given ID.
This method is applicable to DDS_TypeCode objects representing sparse value types (DDS_TK_SPARSE).
<<in>> The member ID.
DDS_Long DDS_TypeCode_member_id | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | index, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Returns the ID of the TypeCode member identified by the given index.
This function is an RTI Connext extension to the CORBA Type Code Specification.
The function can be invoked on aggregation DDS_TypeCode objects.
All members of aggregated types have an integral member ID that uniquely identifies them within their defining type.
In IDL, you can specify the member ID using the built-in annotation ID. For example:
In XML, you can specify the member ID using the attribute 'id':
In XSD, you can specify the member ID using the built-in annotation ID
self | <<in>> Cannot be NULL. |
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_add_member_to_enum | ( | DDS_TypeCode * | self, |
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.
self | <<in>> Cannot be NULL. |
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_to_union | ( | DDS_TypeCode * | self, |
const char * | name, | ||
DDS_Long | id, | ||
const struct DDS_LongSeq * | labels, | ||
const DDS_TypeCode * | tc, | ||
DDS_Boolean | is_pointer, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Add a new member to a union DDS_TypeCode.
This method is applicable to DDS_TypeCode objects representing unions (DDS_TK_UNION).
Modifying a DDS_TypeCode – such as by adding a member – is important if you are using the Dynamic Data APIs.
self | <<in>> Cannot be NULL. |
name | <<in>> The name of the new member. |
id | <<in>> The member ID. For automatic assignment of the member ID specify DDS_TYPECODE_MEMBER_ID_INVALID. |
tc | <<in>> A sequence of labels or case values associated with the member. |
tc | <<in>> The type of the new member. You can get or create this DDS_TypeCode with the DDS_TypeCodeFactory. |
is_pointer | <<in>> Whether the data member, in its deserialized form, should be stored by pointer as opposed to by value. |
ex | <<out>> If this method fails, this argument will contain information about the failure. Possible values include: |
DDS_UnsignedLong DDS_TypeCode_add_member | ( | DDS_TypeCode * | self, |
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.
Calling this method clones the type code passed as the tc
parameter if the type code is not a builtin one. To delete this cloned type code, call DDS_TypeCodeFactory_delete_tc.
The ability to modify 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.
self | <<in>> Cannot be NULL. |
name | <<in>> The name of the new member. |
id | <<in>> Member ID or case value.
|
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 | ( | DDS_TypeCode * | self, |
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.
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.
Calling this method clones the type code passed in as the tc
parameter if the type code is not a builtin one. To delete this cloned type code, call DDS_TypeCodeFactory_delete_tc.
The ability to modify a DDS_TypeCode – such as by adding a member – is important if you are using the Dynamic Data APIs.
self | <<in>> Cannot be NULL. |
name | <<in>> The name of the new member. |
id | <<in>> Member ID or case value.
|
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. Possible values include: |
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 | ( | const DDS_TypeCode * | self, |
DDS_UnsignedLong | indent, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Prints a DDS_TypeCode in a pseudo-IDL notation.
DDS_TypeCodeFactory* DDS_TypeCodeFactory_get_instance | ( | ) |
Gets the singleton instance of this class.
DDS_TypeCode* DDS_TypeCodeFactory_clone_tc | ( | DDS_TypeCodeFactory * | self, |
const DDS_TypeCode * | tc, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Creates and returns a copy of the input DDS_TypeCode.
self | <<in>> Cannot be NULL. |
tc | <<in>> Type code that will be copied. Cannot be NULL. |
ex | <<out>> Parameter for error indications. The values that can take are: |
void DDS_TypeCodeFactory_delete_tc | ( | DDS_TypeCodeFactory * | self, |
DDS_TypeCode * | tc, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Deletes the input DDS_TypeCode.
All the type codes created through the DDS_TypeCodeFactory must be deleted using this function.
const DDS_TypeCode* DDS_TypeCodeFactory_get_primitive_tc | ( | DDS_TypeCodeFactory * | self, |
DDS_TCKind | tc_kind | ||
) |
Get the DDS_TypeCode for a primitive type (integers, floating point values, etc.) identified by the given DDS_TCKind.
This method is equivalent to, and replaces, the DDS_g_tc_*
constants.
DDS_TypeCode* DDS_TypeCodeFactory_create_struct_tc | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
const struct DDS_StructMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_STRUCT DDS_TypeCode.
self | <<in>> Cannot be NULL. |
name | <<in>> Name of the struct type. Cannot be NULL. |
members | <<in>> Initial members of the structure. This list may be empty (that is, FooSeq_get_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.) |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_struct_tc_ex | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
DDS_ExtensibilityKind | extensibility_kind, | ||
const struct DDS_StructMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_STRUCT DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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, FooSeq_get_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.) |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_value_tc | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
DDS_ValueModifier | type_modifier, | ||
const DDS_TypeCode * | concrete_base, | ||
const struct DDS_ValueMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_VALUE DDS_TypeCode.
self | <<in>> Cannot be NULL. |
name | <<in>> Name of the value type. Cannot be NULL. |
type_modifier | <<in>> One of the value type modifier constants: DDS_VM_NONE, DDS_VM_CUSTOM, DDS_VM_ABSTRACT or DDS_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.) |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_value_tc_ex | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
DDS_ExtensibilityKind | extensibility_kind, | ||
DDS_ValueModifier | type_modifier, | ||
const DDS_TypeCode * | concrete_base, | ||
const struct DDS_ValueMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_VALUE DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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_VM_NONE, DDS_VM_CUSTOM, DDS_VM_ABSTRACT or DDS_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.) |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_union_tc | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
const DDS_TypeCode * | discriminator_type, | ||
DDS_Long | default_index, | ||
const struct DDS_UnionMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_UNION DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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.) |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_union_tc_ex | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
DDS_ExtensibilityKind | extensibility_kind, | ||
const DDS_TypeCode * | discriminator_type, | ||
DDS_Long | default_index, | ||
const struct DDS_UnionMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_UNION DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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.) |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_enum_tc | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
const struct DDS_EnumMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_ENUM DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_enum_tc_ex | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
DDS_ExtensibilityKind | extensibility_kind, | ||
const struct DDS_EnumMemberSeq * | members, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_ENUM DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_alias_tc | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
const DDS_TypeCode * | original_type, | ||
DDS_Boolean | is_pointer, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_ALIAS (typedef) DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_string_tc | ( | DDS_TypeCodeFactory * | self, |
DDS_UnsignedLong | bound, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_STRING DDS_TypeCode.
self | <<in>> Cannot be NULL. |
bound | <<in>> Maximum length of the string. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_wstring_tc | ( | DDS_TypeCodeFactory * | self, |
DDS_UnsignedLong | bound, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_WSTRING DDS_TypeCode.
self | <<in>> Cannot be NULL. |
bound | <<in>> Maximum length of the wide string. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_sequence_tc | ( | DDS_TypeCodeFactory * | self, |
DDS_UnsignedLong | bound, | ||
const DDS_TypeCode * | element_type, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_SEQUENCE DDS_TypeCode.
self | <<in>> Cannot be NULL. |
bound | <<in>> The bound for the sequence (> 0). |
element_type | <<in>> DDS_TypeCode object describing the sequence elements. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_array_tc | ( | DDS_TypeCodeFactory * | self, |
const struct DDS_UnsignedLongSeq * | dimensions, | ||
const DDS_TypeCode * | element_type, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_ARRAY DDS_TypeCode.
self | <<in>> Cannot be NULL. |
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. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode* DDS_TypeCodeFactory_create_sparse_tc | ( | DDS_TypeCodeFactory * | self, |
const char * | name, | ||
DDS_ValueModifier | type_modifier, | ||
const DDS_TypeCode * | concrete_base, | ||
DDS_ExceptionCode_t * | ex | ||
) |
Constructs a DDS_TK_SPARSE DDS_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.
self | <<in>> Cannot be NULL. |
name | <<in>> Name of the value type. Cannot be NULL. |
type_modifier | <<in>> One of the value type modifier constants: DDS_VM_NONE, DDS_VM_CUSTOM, DDS_VM_ABSTRACT or DDS_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. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_TypeCode DDS_g_tc_null |
Basic NULL type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_short |
Basic 16-bit signed integer type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_long |
Basic 32-bit signed integer type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_ushort |
Basic unsigned 16-bit integer type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_ulong |
Basic unsigned 32-bit integer type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_float |
Basic 32-bit floating point type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_double |
Basic 64-bit floating point type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_boolean |
Basic Boolean type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_char |
Basic single-byte character type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_octet |
Basic octet/byte type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_longlong |
Basic 64-bit integer type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_ulonglong |
Basic unsigned 64-bit integer type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_longdouble |
Basic 128-bit floating point type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.
DDS_TypeCode DDS_g_tc_wchar |
Basic four-byte character type.
For new code, DDS_TypeCodeFactory_get_primitive_tc is preferred to using this global variable.