RTI Connext Traditional C++ API Version 7.2.0
|
The definition of a particular data type, which you can use to inspect the name, members, and other properties of types generated with rtiddsgen (see the Code Generator User's Manual) or to modify types you define yourself at runtime. More...
Public Member Functions | |
DDS_TCKind | kind (DDS_ExceptionCode_t &ex) const |
Gets the DDS_TCKind value of a type code. More... | |
DDS_ExtensibilityKind | extensibility_kind (DDS_ExceptionCode_t &ex) const |
Gets the DDS_ExtensibilityKind value of a type code. More... | |
DDS_Boolean | equal (const DDS_TypeCode *tc, DDS_ExceptionCode_t &ex) const |
Compares two DDS_TypeCode objects for equality. More... | |
const char * | name (DDS_ExceptionCode_t &ex) const |
Retrieves the simple name identifying this DDS_TypeCode object within its enclosing scope. More... | |
DDS_UnsignedLong | member_count (DDS_ExceptionCode_t &ex) const |
Returns the number of members of the type code. More... | |
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. More... | |
DDS_UnsignedLong | find_member_by_name (const char *name, DDS_ExceptionCode_t &ex) const |
Get the index of the member of the given name. More... | |
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. More... | |
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. More... | |
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. More... | |
DDS_Long | member_ordinal (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the ordinal that corresponds to the index-th enum value. More... | |
DDS_Boolean | is_member_key (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Function that tells if a member is a key or not. More... | |
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. More... | |
DDS_Boolean | is_member_pointer (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Function that tells if a member is a pointer or not. More... | |
DDS_Boolean | is_member_bitfield (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Function that tells if a member is a bitfield or not. More... | |
DDS_Short | member_bitfield_bits (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the number of bits of a bitfield member. More... | |
DDS_Visibility | member_visibility (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the constant that indicates the visibility of the index-th member. More... | |
DDS_TypeCode * | discriminator_type (DDS_ExceptionCode_t &ex) const |
Returns the discriminator type code. More... | |
DDS_UnsignedLong | length (DDS_ExceptionCode_t &ex) const |
Returns the number of elements in the type described by this type code. More... | |
DDS_UnsignedLong | array_dimension_count (DDS_ExceptionCode_t &ex) const |
This function returns the number of dimensions of an array type code. More... | |
DDS_UnsignedLong | array_dimension (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
This function returns the index-th dimension of an array type code. More... | |
DDS_UnsignedLong | element_count (DDS_ExceptionCode_t &ex) const |
The number of elements in an array. More... | |
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. More... | |
DDS_Boolean | is_alias_pointer (DDS_ExceptionCode_t &ex) const |
Function that tells if an alias is a pointer or not. More... | |
DDS_Long | default_index (DDS_ExceptionCode_t &ex) const |
Returns the index of the default member, or -1 if there is no default member. More... | |
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. More... | |
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. More... | |
DDS_Long | member_id (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) const |
Returns the ID of the TypeCode member identified by the given index. More... | |
DDS_UnsignedLong | find_member_by_id (DDS_Long id, DDS_ExceptionCode_t &ex) const |
Get the index of the member of the given ID. More... | |
DDS_UnsignedLong | get_type_object_serialized_size (DDS_ExceptionCode_t &ex) const |
Gets the serialized size of the TypeObject created from this DDS_TypeCode. More... | |
DDS_UnsignedLong | get_cdr_serialized_sample_max_size (DDS_DataRepresentationId_t representation_id, DDS_ExceptionCode_t &ex) const |
[DEPRECATED] Gets the maximum serialized size of samples of this type More... | |
DDS_UnsignedLong | cdr_serialized_sample_max_size (DDS_DataRepresentationId_t representation_id, DDS_ExceptionCode_t &ex) const |
Gets the maximum serialized size of samples of this type. More... | |
DDS_UnsignedLong | cdr_serialized_sample_min_size (DDS_DataRepresentationId_t representation_id, DDS_ExceptionCode_t &ex) const |
Gets the minimum serialized size of samples of this type. More... | |
DDS_UnsignedLong | cdr_serialized_sample_key_max_size (DDS_DataRepresentationId_t representation_id, DDS_ExceptionCode_t &ex) const |
Gets the maximum serialized size of sample keys of this type. More... | |
DDS_UnsignedLong | cdr_serialized_sample_max_size (DDS_ExceptionCode_t &ex) const |
Gets the maximum serialized size of samples of this type. More... | |
DDS_UnsignedLong | cdr_serialized_sample_min_size (DDS_ExceptionCode_t &ex) const |
Gets the minimum serialized size of samples of this type. More... | |
DDS_UnsignedLong | cdr_serialized_sample_key_max_size (DDS_ExceptionCode_t &ex) const |
Gets the maximum serialized size of sample keys of this type. More... | |
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. More... | |
DDS_UnsignedLong | add_member_to_union (const char *name, DDS_Long id, const DDS_LongSeq &labels, const DDS_TypeCode *tc, DDS_Boolean is_pointer, DDS_ExceptionCode_t &ex) |
Add a new member to a union DDS_TypeCode. More... | |
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. More... | |
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. More... | |
const DDS_AnnotationParameterValue * | default_value (DDS_ExceptionCode_t &ex) |
Returns the default annotation for this DDS_TypeCode. More... | |
const DDS_AnnotationParameterValue * | min_value (DDS_ExceptionCode_t &ex) |
Returns the min annotation for this DDS_TypeCode. More... | |
const DDS_AnnotationParameterValue * | max_value (DDS_ExceptionCode_t &ex) |
Returns the max annotation for this DDS_TypeCode. More... | |
const DDS_AnnotationParameterValue * | member_default_value (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) |
Returns the member default annotation for this DDS_TypeCode. More... | |
const DDS_AnnotationParameterValue * | member_min_value (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) |
Returns the member min annotation for this DDS_TypeCode. More... | |
const DDS_AnnotationParameterValue * | member_max_value (DDS_UnsignedLong index, DDS_ExceptionCode_t &ex) |
Returns the member max annotation for this DDS_TypeCode. More... | |
void | print_IDL (DDS_UnsignedLong indent, DDS_ExceptionCode_t &ex) const |
Prints a DDS_TypeCode in IDL notation. More... | |
void | print (const DDS_TypeCodePrintFormatProperty &format, DDS_ExceptionCode_t &ex) const |
Prints a DDS_TypeCode. More... | |
void | to_string (char *str, DDS_UnsignedLong &str_size, DDS_ExceptionCode_t &ex) const |
Get a string representation of this DDS_TypeCode object using the default values for DDS_TypeCodePrintFormatProperty. More... | |
void | to_string (char *str, DDS_UnsignedLong &str_size, const DDS_TypeCodePrintFormatProperty &format, DDS_ExceptionCode_t &ex) const |
Get a string representation of this DDS_TypeCode object using the format described by DDS_TypeCodePrintFormatProperty. More... | |
The definition of a particular data type, which you can use to inspect the name, members, and other properties of types generated with rtiddsgen (see the Code Generator User's Manual) or to modify types you define yourself at runtime.
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: |
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.
DDS_ExtensibilityKind DDS_TypeCode::extensibility_kind | ( | DDS_ExceptionCode_t & | ex | ) | const |
Gets the DDS_ExtensibilityKind value of a type code.
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 * | tc, |
DDS_ExceptionCode_t & | ex | ||
) | const |
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.
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.
This method is applicable to DDS_TypeCode objects representing structs (DDS_TK_STRUCT) and union (DDS_TK_UNION) types.
name | <<in>> The member name. |
ex | <<out>> Parameter for error indications. The values that can take are: |
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.
A non-key member is required if it has not been marked as optional. All key members 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.
For DDS_TK_STRUCT, this method always returns DDS_PUBLIC_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.
For DDS_TK_STRUCT, this method 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.
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.
For DDS_TK_STRUCT, this method always returns DDS_VM_NONE.
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 the TypeCode member identified by the given index.
This function is an RTI Connext extension to the CORBA Type Code Specification.
The method 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
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.
This method is applicable to DDS_TypeCode objects representing structs (DDS_TK_STRUCT) and union (DDS_TK_UNION) types.
id | <<in>> The member ID. |
ex | <<out>> Parameter for error indications. The values that can take are: |
DDS_UnsignedLong DDS_TypeCode::get_type_object_serialized_size | ( | DDS_ExceptionCode_t & | ex | ) | const |
Gets the serialized size of the TypeObject created from this DDS_TypeCode.
ex | <<out>> Parameter for error indications. The values that it can take are: |
The default buffer size used for storing a TypeObject is 8192 bytes. For a large TypeObject, this API can be used to determine the size that needs to be set in DDS_DomainParticipantResourceLimitsQosPolicy::type_object_max_serialized_length
DDS_UnsignedLong DDS_TypeCode::get_cdr_serialized_sample_max_size | ( | DDS_DataRepresentationId_t | representation_id, |
DDS_ExceptionCode_t & | ex | ||
) | const |
[DEPRECATED] Gets the maximum serialized size of samples of this type
DEPRECATED: use DDS_TypeCode::cdr_serialized_sample_max_size instead.
Obtains the maximum possible size in bytes of any serialized data sample of this type.
representation_id | The serialized data representation for which we calculate the maximum size. |
ex | <<out>> Parameter for error indications. |
DDS_UnsignedLong DDS_TypeCode::cdr_serialized_sample_max_size | ( | DDS_DataRepresentationId_t | representation_id, |
DDS_ExceptionCode_t & | ex | ||
) | const |
Gets the maximum serialized size of samples of this type.
Obtains the maximum possible size in bytes of any serialized data sample of this type.
representation_id | The serialized data representation for which we calculate the maximum size. |
ex | <<out>> Parameter for error indications. |
DDS_UnsignedLong DDS_TypeCode::cdr_serialized_sample_min_size | ( | DDS_DataRepresentationId_t | representation_id, |
DDS_ExceptionCode_t & | ex | ||
) | const |
Gets the minimum serialized size of samples of this type.
Obtains the minimum possible size in bytes of any serialized data sample of this type.
representation_id | The serialized data representation for which we calculate the minimum size. |
ex | <<out>> Parameter for error indications. |
DDS_UnsignedLong DDS_TypeCode::cdr_serialized_sample_key_max_size | ( | DDS_DataRepresentationId_t | representation_id, |
DDS_ExceptionCode_t & | ex | ||
) | const |
Gets the maximum serialized size of sample keys of this type.
Obtains the maximum possible size in bytes of the serialized keys of any data sample of this type
representation_id | The serialized data representation for which we calculate the maximum key size. |
ex | <<out>> Parameter for error indications. |
DDS_UnsignedLong DDS_TypeCode::cdr_serialized_sample_max_size | ( | DDS_ExceptionCode_t & | ex | ) | const |
Gets the maximum serialized size of samples of this type.
Obtains the maximum possible size in bytes of any serialized data sample of this type.
Assumes the DDS_DataRepresentationId_t to be DDS_AUTO_DATA_REPRESENTATION
ex | <<out>> Parameter for error indications. |
DDS_UnsignedLong DDS_TypeCode::cdr_serialized_sample_min_size | ( | DDS_ExceptionCode_t & | ex | ) | const |
Gets the minimum serialized size of samples of this type.
Obtains the minimum possible size in bytes of any serialized data sample of this type.
Assumes the DDS_DataRepresentationId_t to be DDS_AUTO_DATA_REPRESENTATION
ex | <<out>> Parameter for error indications. |
DDS_UnsignedLong DDS_TypeCode::cdr_serialized_sample_key_max_size | ( | DDS_ExceptionCode_t & | ex | ) | const |
Gets the maximum serialized size of sample keys of this type.
Obtains the maximum possible size in bytes of the serialized keys of any data sample of this type
Assumes the DDS_DataRepresentationId_t to be DDS_AUTO_DATA_REPRESENTATION
ex | <<out>> Parameter for error indications. |
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_to_union | ( | const char * | name, |
DDS_Long | id, | ||
const 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.
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. |
labels | <<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 | ( | 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), 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.
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 | ( | 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), 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.
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. 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: |
const DDS_AnnotationParameterValue * DDS_TypeCode::default_value | ( | DDS_ExceptionCode_t & | ex | ) |
Returns the default annotation for this DDS_TypeCode.
ex | <<out>> Parameter for error indications. The values that can take are: |
const DDS_AnnotationParameterValue * DDS_TypeCode::min_value | ( | DDS_ExceptionCode_t & | ex | ) |
Returns the min annotation for this DDS_TypeCode.
ex | <<out>> Parameter for error indications. The values that can take are: |
const DDS_AnnotationParameterValue * DDS_TypeCode::max_value | ( | DDS_ExceptionCode_t & | ex | ) |
Returns the max annotation for this DDS_TypeCode.
ex | <<out>> Parameter for error indications. The values that can take are: |
const DDS_AnnotationParameterValue * DDS_TypeCode::member_default_value | ( | DDS_UnsignedLong | index, |
DDS_ExceptionCode_t & | ex | ||
) |
Returns the member default annotation for this DDS_TypeCode.
index | index of the target member |
ex | <<out>> Parameter for error indications. The values that can take are: |
const DDS_AnnotationParameterValue * DDS_TypeCode::member_min_value | ( | DDS_UnsignedLong | index, |
DDS_ExceptionCode_t & | ex | ||
) |
Returns the member min annotation for this DDS_TypeCode.
index | index of the target member |
ex | <<out>> Parameter for error indications. The values that can take are: |
const DDS_AnnotationParameterValue * DDS_TypeCode::member_max_value | ( | DDS_UnsignedLong | index, |
DDS_ExceptionCode_t & | ex | ||
) |
Returns the member max annotation for this DDS_TypeCode.
index | index of the target member |
ex | <<out>> Parameter for error indications. The values that can take are: |
void DDS_TypeCode::print_IDL | ( | DDS_UnsignedLong | indent, |
DDS_ExceptionCode_t & | ex | ||
) | const |
Prints a DDS_TypeCode in IDL notation.
void DDS_TypeCode::print | ( | const DDS_TypeCodePrintFormatProperty & | format, |
DDS_ExceptionCode_t & | ex | ||
) | const |
Prints a DDS_TypeCode.
void DDS_TypeCode::to_string | ( | char * | str, |
DDS_UnsignedLong & | str_size, | ||
DDS_ExceptionCode_t & | ex | ||
) | const |
Get a string representation of this DDS_TypeCode object using the default values for DDS_TypeCodePrintFormatProperty.
This function obtains a string representation of a DDS_TypeCode object, it creates this string using the default values of DDS_TypeCodePrintFormatProperty.
In order to calculate the required length of the string, the user can call this function with the parameter str set to NULL. In this mode, the required length of the string will be stored into the value pointed to by the parameter str_size.
If the parameter str is not equal to NULL, the string representation of the DDS_TypeCode will be stored into the parameter str. In this mode, if the size of the string is insufficient to hold the result, the parameter *ex will be set to DDS_BAD_PARAM_SYSTEM_EXCEPTION_CODE and the parameter str_size will be updated to hold the required size of the string. All string lengths include the trailing NUL byte.
str | <<out>> The char buffer that will be used to store the string representation of the DDS_TypeCode. If NULL then this function will store the required length of the buffer into the value pointed to by the str_size parameter. |
str_size | <<inout>> Cannot be NULL. The length of the char buffer. If the supplied buffer is NULL or insufficiently long, the value pointed to by this parameter will be updated to contain the required length. |
ex | <<out>> Parameter used for error indications. |
void DDS_TypeCode::to_string | ( | char * | str, |
DDS_UnsignedLong & | str_size, | ||
const DDS_TypeCodePrintFormatProperty & | format, | ||
DDS_ExceptionCode_t & | ex | ||
) | const |
Get a string representation of this DDS_TypeCode object using the format described by DDS_TypeCodePrintFormatProperty.
This function behaves in the same way as DDS_TypeCode::to_string but allows the user to specify the format of the string using DDS_TypeCodePrintFormatProperty.
str | <<out>> The char buffer which will hold the string representation of the DDS_TypeCode. |
str_size | <<inout>> Cannot be NULL. The length of the char buffer pointed to by the str parameter. If the str parameter is NULL, or too small, this parameter will be updated to hold the required length of the buffer. |
format | <<in>> The DDS_TypeCodePrintFormatProperty used to define the format of the string representation of the DDS_TypeCode. |
ex | <<out>> Parameter used for error indications. |