RTI Connext Java API
Version 7.0.0
|
A factory for registering a dynamically defined type and creating com.rti.dds.dynamicdata.DynamicData objects. More...
Public Member Functions | |
final void | register_type (DomainParticipant participant, String type_name) |
Associate the com.rti.dds.typecode.TypeCode with the given com.rti.dds.domain.DomainParticipant under the given logical name. More... | |
final void | unregister_type (DomainParticipant participant, String type_name) |
Remove the definition of this type from the com.rti.dds.domain.DomainParticipant. More... | |
final String | get_type_name () |
Get the default name of this type. More... | |
final TypeCode | get_data_type () |
Get the com.rti.dds.typecode.TypeCode wrapped by this com.rti.dds.dynamicdata.DynamicDataTypeSupport. More... | |
Object | create_data () |
Create a new com.rti.dds.dynamicdata.DynamicData sample initialized with the com.rti.dds.typecode.TypeCode and properties of this com.rti.dds.dynamicdata.DynamicDataTypeSupport. More... | |
void | destroy_data (Object data) |
Finalize and deallocate the com.rti.dds.dynamicdata.DynamicData sample. More... | |
void | print_data (DynamicData data) |
Print a string representation of the given sample to the given file. More... | |
void | copy_data (DynamicData dst, DynamicData src) |
Deeply copy the given data samples. More... | |
void | to_cdr_buffer (ByteSeq sequence, DynamicData data, short representation) |
Serializes the specified DynamicData object into a sequence of octets. More... | |
void | to_cdr_buffer (ByteSeq sequence, DynamicData data) |
Serializes the specified DynamicData object into a CDR sequence of octets. More... | |
void | from_cdr_buffer (DynamicData data, ByteSeq sequence) |
Deserializes the specified DynamicData object from a sequence octets. More... | |
void | delete () |
Delete a com.rti.dds.dynamicdata.DynamicDataTypeSupport object. More... | |
DynamicDataTypeSupport (TypeCode type, DynamicDataTypeProperty_t props) | |
Construct a new com.rti.dds.dynamicdata.DynamicDataTypeSupport object. More... | |
Static Public Attributes | |
static final DynamicDataTypeProperty_t | TYPE_PROPERTY_DEFAULT |
Sentinel constant indicating default values for com.rti.dds.dynamicdata.DynamicDataTypeProperty_t. More... | |
Static Protected Attributes | |
static final RuntimeException | DYNAMICDATA_TYPE_NOT_SUPPORTED = new RETCODE_ERROR("not a top-level type") |
A factory for registering a dynamically defined type and creating com.rti.dds.dynamicdata.DynamicData objects.
A com.rti.dds.dynamicdata.DynamicDataTypeSupport has three roles:
DynamicDataTypeSupport | ( | TypeCode | type, |
DynamicDataTypeProperty_t | props | ||
) |
Construct a new com.rti.dds.dynamicdata.DynamicDataTypeSupport object.
This step is usually followed by type registration.
The new object created by this constructor retains a reference to the com.rti.dds.typecode.TypeCode that is passed in. It is not safe to delete the com.rti.dds.typecode.TypeCode until the com.rti.dds.dynamicdata.DynamicDataTypeSupport itself is deleted. You have two options:
If the object cannot be created, this method throws com.rti.dds.infrastructure.RETCODE_ERROR.
type | The com.rti.dds.typecode.TypeCode that describes the members of this type. |
props | Policies that describe how to manage the memory and other properties of the data samples created by this factory. In most cases, the default values will be appropriate; see com.rti.dds.dynamicdata.DynamicDataTypeSupport.TYPE_PROPERTY_DEFAULT. |
One | of the Standard Return Codes |
References DynamicDataProperty_t.buffer_initial_size, DynamicDataProperty_t.buffer_max_size, DynamicDataTypeProperty_t.data, DynamicDataTypeSerializationProperty_t.max_size_serialized, DynamicDataTypeSerializationProperty_t.min_size_serialized, DynamicDataTypeProperty_t.serialization, DynamicDataTypeSerializationProperty_t.trim_to_size, and DynamicDataTypeSerializationProperty_t.use_42e_compatible_alignment.
final void register_type | ( | DomainParticipant | participant, |
String | type_name | ||
) |
Associate the com.rti.dds.typecode.TypeCode with the given com.rti.dds.domain.DomainParticipant under the given logical name.
Once a type has been registered, it can be referenced by name when creating a topic. Statically and dynamically defined types behave the same way in this respect.
If the type cannot be registered, this function will fail with com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES.
final void unregister_type | ( | DomainParticipant | participant, |
String | type_name | ||
) |
Remove the definition of this type from the com.rti.dds.domain.DomainParticipant.
This operation is optional; all types are automatically unregistered when a com.rti.dds.domain.DomainParticipant is deleted. Most application will not need to manually unregister types.
A type cannot be unregistered while it is still in use; that is, while any com.rti.dds.topic.Topic is still referring to it.
If the type cannot be unregistered, this function will fail with com.rti.dds.infrastructure.RETCODE_ERROR or com.rti.dds.infrastructure.RETCODE_BAD_PARAMETER.
final String get_type_name | ( | ) |
Get the default name of this type.
The com.rti.dds.typecode.TypeCode that is wrapped by this com.rti.dds.dynamicdata.DynamicDataTypeSupport includes a name; this operation returns that name.
This operation is useful when registering a type, because in most cases it is not necessary for the physical and logical names of the type to be different.
final TypeCode get_data_type | ( | ) |
Get the com.rti.dds.typecode.TypeCode wrapped by this com.rti.dds.dynamicdata.DynamicDataTypeSupport.
Object create_data | ( | ) |
Create a new com.rti.dds.dynamicdata.DynamicData sample initialized with the com.rti.dds.typecode.TypeCode and properties of this com.rti.dds.dynamicdata.DynamicDataTypeSupport.
If this method fails, it will throw a Runtime Exception.
void destroy_data | ( | Object | data | ) |
Finalize and deallocate the com.rti.dds.dynamicdata.DynamicData sample.
References DynamicData.delete().
void print_data | ( | DynamicData | data | ) |
Print a string representation of the given sample to the given file.
This method is equivalent to com.rti.dds.dynamicdata.DynamicData.print.
void copy_data | ( | DynamicData | dst, |
DynamicData | src | ||
) |
Deeply copy the given data samples.
void to_cdr_buffer | ( | ByteSeq | sequence, |
DynamicData | data, | ||
short | representation | ||
) |
Serializes the specified DynamicData object into a sequence of octets.
This method serializes the specified DynamicData object into a sequence of octets using the input data representation.
The behavior of this method is the same as that of the com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer method, except that it receives the DynamicData object to be serialized and a com.rti.dds.infrastructure.ByteSeq as a serialization output.
This method may resize sequence
as needed to fit the serialized DynamicData object.
sequence | <<out>>. Serialization byte sequence. |
data | <<in>>. The DynamicData object to be serialized. Cannot be null. |
representation | <<in>>. Representation used to serialize the data. |
One | of the Standard Return Codes |
References DynamicData.to_cdr_buffer().
Referenced by DynamicDataTypeSupport.to_cdr_buffer().
void to_cdr_buffer | ( | ByteSeq | sequence, |
DynamicData | data | ||
) |
Serializes the specified DynamicData object into a CDR sequence of octets.
This method serializes the specified DynamicData object into a sequence of octets, using CDR as the data representation.
The behavior of this method is the same as that of the com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer method, except that it receives the DynamicData object to be serialized and a com.rti.dds.infrastructure.ByteSeq as output.
This method may resize sequence
as needed to fit the serialized dynamicData object.
sequence | <<out>>. Serialization byte sequence. |
data | <<in>>. The DynamicData object to be serialized. Cannot be null. |
One | of the Standard Return Codes |
References DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION, and DynamicDataTypeSupport.to_cdr_buffer().
void from_cdr_buffer | ( | DynamicData | data, |
ByteSeq | sequence | ||
) |
Deserializes the specified DynamicData object from a sequence octets.
This method deserializes the specified DynamicData object from a CDR sequence of octets.
The behavior of this method is the same as that of the com.rti.dds.dynamicdata.DynamicData.from_cdr_buffer method, except that it receives the DynamicData object that contains the result of the deserialization, and a com.rti.dds.infrastructure.ByteSeq as deserialization input.
data | <<in>>. The DynamicData object to hold the result of the deserialization. |
sequence | <<in>>. Deserialization octet sequence. Cannot be null. |
One | of the Standard Return Codes |
References DynamicData.from_cdr_buffer().
void delete | ( | ) |
Delete a com.rti.dds.dynamicdata.DynamicDataTypeSupport object.
A com.rti.dds.dynamicdata.DynamicDataTypeSupport cannot be deleted while it is still in use. For each com.rti.dds.domain.DomainParticipant with which the com.rti.dds.dynamicdata.DynamicDataTypeSupport is registered, either the type must be unregistered or the participant must be deleted.
Calling this method is optional. If you do not call it, the garbage collector will perform the deletion when it is able.
References DynamicDataTypeSupport.DYNAMICDATA_TYPE_NOT_SUPPORTED, TypeCode.kind(), TypeCode.name(), TCKind.TK_ENUM, and TCKind.TK_UNION.
|
staticprotected |
Cached exception to be thrown in the event that we can't create native type support.
Referenced by DynamicDataTypeSupport.delete().