RTI Connext Java API  Version 6.0.0
 All Classes Namespaces Functions Variables Groups Pages
DynamicDataTypeSupport Class Reference

A factory for registering a dynamically defined type and creating com.rti.dds.dynamicdata.DynamicData objects. More...

Inheritance diagram for DynamicDataTypeSupport:
TypeSupport

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.
 
final void unregister_type (DomainParticipant participant, String type_name)
 Remove the definition of this type from the com.rti.dds.domain.DomainParticipant.
 
final String get_type_name ()
 Get the default name of this type.
 
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.
 
void destroy_data (Object data)
 Finalize and deallocate the com.rti.dds.dynamicdata.DynamicData sample.
 
void print_data (DynamicData data)
 Print a string representation of the given sample to the given file.
 
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.
 
void to_cdr_buffer (ByteSeq sequence, DynamicData data)
 Serializes the specified DynamicData object into a CDR sequence of octets.
 
void from_cdr_buffer (DynamicData data, ByteSeq sequence)
 Deserializes the specified DynamicData object from a sequence octets.
 
void delete ()
 Delete a com.rti.dds.dynamicdata.DynamicDataTypeSupport object.
 
 DynamicDataTypeSupport (TypeCode type, DynamicDataTypeProperty_t props)
 Construct a new com.rti.dds.dynamicdata.DynamicDataTypeSupport object.
 

Static Public Attributes

static final
DynamicDataTypeProperty_t 
TYPE_PROPERTY_DEFAULT
 Sentinel constant indicating default values for com.rti.dds.dynamicdata.DynamicDataTypeProperty_t.
 

Static Protected Attributes

static final RuntimeException DYNAMICDATA_TYPE_NOT_SUPPORTED = new RETCODE_ERROR("not a top-level type")
 

Detailed Description

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:

  1. It associates a com.rti.dds.typecode.TypeCode with policies for managing objects of that type. See the constructor, com.rti.dds.dynamicdata.DynamicDataTypeSupport.DynamicDataTypeSupport.DynamicDataTypeSupport.
  2. It registers its type under logical names with a com.rti.dds.domain.DomainParticipant. See com.rti.dds.dynamicdata.DynamicDataTypeSupport.register_type.
  3. It creates com.rti.dds.dynamicdata.DynamicData samples pre-initialized with the type and properties of the type support itself. See com.rti.dds.dynamicdata.DynamicDataTypeSupport.create_data.

Constructor & Destructor Documentation

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.

Parameters
typeThe com.rti.dds.typecode.TypeCode that describes the members of this type.
propsPolicies 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.
See Also
com.rti.dds.dynamicdata.DynamicDataTypeSupport.register_type
Exceptions
Oneof the Standard Return Codes

Member Function Documentation

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 will fail with com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES.

See Also
com.rti.ndds.example.FooTypeSupport.register_type
com.rti.dds.domain.DomainParticipant.create_topic
com.rti.dds.dynamicdata.DynamicDataTypeSupport.unregister_type
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 will fail with com.rti.dds.infrastructure.RETCODE_ERROR or com.rti.dds.infrastructure.RETCODE_BAD_PARAMETER.

See Also
com.rti.ndds.example.FooTypeSupport.unregister_type
com.rti.dds.dynamicdata.DynamicDataTypeSupport.register_type
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.

myTypeSupport.register_type(myParticipant, myTypeSupport.get_type_name());
See Also
com.rti.ndds.example.FooTypeSupport.get_type_name
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.

See Also
com.rti.ndds.example.FooTypeSupport.create_data
com.rti.dds.dynamicdata.DynamicData.DynamicData.DynamicData
com.rti.dds.dynamicdata.DynamicDataTypeProperty_t.data
void destroy_data ( Object  data)

Finalize and deallocate the com.rti.dds.dynamicdata.DynamicData sample.

See Also
com.rti.ndds.example.FooTypeSupport.delete_data
com.rti.dds.dynamicdata.DynamicDataTypeSupport.create_data
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.

See Also
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.

See Also
com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer
Parameters
sequence<<out>>. Serialization byte sequence.
data<<in>>. The DynamicData object to be serialized. Cannot be null.
representation<<in>>. Representation used to serialize the data.
Exceptions
Oneof the Standard Return Codes
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.

See Also
com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer
Parameters
sequence<<out>>. Serialization byte sequence.
data<<in>>. The DynamicData object to be serialized. Cannot be null.
Exceptions
Oneof the Standard Return Codes
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.

See Also
com.rti.dds.dynamicdata.DynamicData.from_cdr_buffer
Parameters
data<<in>>. The DynamicData object to hold the result of the deserialization.
sequence<<in>>. Deserialization octet sequence. Cannot be null.
Exceptions
Oneof the Standard Return Codes
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.

See Also
com.rti.dds.dynamicdata.DynamicDataTypeSupport.unregister_type
com.rti.dds.dynamicdata.DynamicDataTypeSupport.DynamicDataTypeSupport.DynamicDataTypeSupport

Member Data Documentation

final RuntimeException DYNAMICDATA_TYPE_NOT_SUPPORTED = new RETCODE_ERROR("not a top-level type")
staticprotected

Cached exception to be thrown in the event that we can't create native type support.


RTI Connext Java API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc