DynamicDataTypeSupport Class Reference
[Dynamic Data]

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

Inheritance diagram for DynamicDataTypeSupport:

TypeSupport

List of all members.

Public Member Functions

final void register_type (DomainParticipant participant, String type_name)
 Associate the 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 TypeCode wrapped by this com.rti.dds.dynamicdata.DynamicDataTypeSupport.
Object create_data ()
 Create a new com.rti.dds.dynamicdata.DynamicData sample initialized with the 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 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 TypeCode with policies for managing objects of that type. See the constructor, 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 TypeCode that is passed in. It is not safe to delete the TypeCode until the com.rti.dds.dynamicdata.DynamicDataTypeSupport itself is deleted. You have two options:

Parameters:
type The 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 DynamicDataTypeSupport.TYPE_PROPERTY_DEFAULT.
See also:
com.rti.dds.dynamicdata.DynamicDataTypeSupport.register_type


Member Function Documentation

final void register_type ( DomainParticipant  participant,
String  type_name 
)

Associate the 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.

See also:
com.rti.dds.topic.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.

See also:
com.rti.dds.topic.example.FooTypeSupport.unregister_type

com.rti.dds.dynamicdata.DynamicDataTypeSupport.register_type

final String get_type_name (  ) 

Get the default name of this type.

The 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.dds.topic.example.FooTypeSupport.get_type_name

final TypeCode get_data_type (  ) 

Get the TypeCode wrapped by this com.rti.dds.dynamicdata.DynamicDataTypeSupport.

Object create_data (  ) 

Create a new com.rti.dds.dynamicdata.DynamicData sample initialized with the TypeCode and properties of this com.rti.dds.dynamicdata.DynamicDataTypeSupport.

See also:
com.rti.dds.topic.example.FooTypeSupport.create_data

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.dds.topic.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 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

DynamicDataTypeSupport.DynamicDataTypeSupport


Member Data Documentation

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

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


RTI Connext Java API Version 4.5f Copyright © 17 Mar 2012 Real-Time Innovations, Inc