DDS::DynamicDataTypeSupport Class Reference
[Dynamic Data]

A factory for registering a dynamically defined type and creating DDS::DynamicData objects. More...

#include <managed_dynamicdata.h>

Inheritance diagram for DDS::DynamicDataTypeSupport:

DDS::TypeSupport

List of all members.

Public Member Functions

 DynamicDataTypeSupport (TypeCode^ type, DynamicDataTypeProperty_t^ props)
 Construct a new DDS::DynamicDataTypeSupport object.
virtual ~DynamicDataTypeSupport ()
 Delete a DDS::DynamicDataTypeSupport object.
System::Boolean is_valid ()
 Indicates whether the object was constructed properly.
void register_type (DomainParticipant^ participant, System::String^ type_name)
 Associate the DDS::TypeCode with the given DDS::DomainParticipant under the given logical name.
void unregister_type (DomainParticipant^ participant, System::String^ type_name)
 Remove the definition of this type from the DDS::DomainParticipant.
System::String^ get_type_name ()
 Get the default name of this type.
TypeCodeget_data_type ()
 Get the DDS::TypeCode wrapped by this DDS::DynamicDataTypeSupport.
DynamicDatacreate_data ()
 Create a new DDS::DynamicData sample initialized with the DDS::TypeCode and properties of this DDS::DynamicDataTypeSupport.
void delete_data (DynamicData^ a_data)
 Finalize and deallocate the DDS::DynamicData sample.
void copy_data (DynamicData^ dest, DynamicData^ source)
 Deeply copy the given data samples.


Detailed Description

A factory for registering a dynamically defined type and creating DDS::DynamicData objects.

A DDS::DynamicDataTypeSupport has three roles:

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

Constructor & Destructor Documentation

DDS::DynamicDataTypeSupport::DynamicDataTypeSupport ( TypeCode^   type,
DynamicDataTypeProperty_t^   props 
)

Construct a new DDS::DynamicDataTypeSupport object.

This step is usually followed by type registration.

Parameters:
type The DDS::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 DDS::DynamicDataTypeProperty_t.DYNAMIC_DATA_TYPE_PROPERTY_DEFAULT.
See also:
DDS::DynamicDataTypeSupport::register_type

virtual DDS::DynamicDataTypeSupport::~DynamicDataTypeSupport (  )  [inline, virtual]

Delete a DDS::DynamicDataTypeSupport object.

A DDS::DynamicDataTypeSupport cannot be deleted while it is still in use. For each DDS::DomainParticipant with which the DDS::DynamicDataTypeSupport is registered, either the type must be unregistered or the participant must be deleted.

See also:
DDS::DynamicDataTypeSupport::unregister_type

DDS::DynamicDataTypeSupport::DynamicDataTypeSupport


Member Function Documentation

System::Boolean DDS::DynamicDataTypeSupport::is_valid (  ) 

Indicates whether the object was constructed properly.

This method returns true if the constructor succeeded; it returns false if the constructor failed for any reason, which should also have resulted in a log message.

Possible failure reasons include passing an invalid type or invalid properties to the constructor.

This method is necessary because C++ exception support is not consistent across all of the platforms on which RTI Data Distribution Service runs. Therefore, the implementation does not throw any exceptions in the constructor.

See also:
DDS::DynamicDataTypeSupport::DynamicDataTypeSupport

void DDS::DynamicDataTypeSupport::register_type ( DomainParticipant^   participant,
System::String^   type_name 
)

Associate the DDS::TypeCode with the given DDS::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:
FooTypeSupport::register_type

DDS::DomainParticipant::create_topic

DDS::DynamicDataTypeSupport::unregister_type

void DDS::DynamicDataTypeSupport::unregister_type ( DomainParticipant^   participant,
System::String^   type_name 
)

Remove the definition of this type from the DDS::DomainParticipant.

This operation is optional; all types are automatically unregistered when a DDS::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 DDS::Topic is still referring to it.

See also:
FooTypeSupport::unregister_type

DDS::DynamicDataTypeSupport::register_type

System::String ^ DDS::DynamicDataTypeSupport::get_type_name (  ) 

Get the default name of this type.

The DDS::TypeCode that is wrapped by this DDS::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.

In C#:

 myTypeSupport.register_type(myParticipant, myTypeSupport.get_type_name()); 

In C++/CLI:

 myTypeSupport->register_type(myParticipant, myTypeSupport->get_type_name()); 

See also:
FooTypeSupport::get_type_name

TypeCode ^ DDS::DynamicDataTypeSupport::get_data_type (  ) 

Get the DDS::TypeCode wrapped by this DDS::DynamicDataTypeSupport.

DynamicData ^ DDS::DynamicDataTypeSupport::create_data (  ) 

Create a new DDS::DynamicData sample initialized with the DDS::TypeCode and properties of this DDS::DynamicDataTypeSupport.

You must delete your DDS::DynamicData object when you are finished with it.

In C#:

 DynamicData sample = myTypeSupport.create_data(); 
  // Do something... 
  myTypeSupport.delete_data(sample); 

In C++/CLI:

 DynamicData^ sample = myTypeSupport->create_data(); 
  // Do something... 
  myTypeSupport->delete_data(sample); 

See also:
DDS::DynamicDataTypeSupport::delete_data

FooTypeSupport::create_data

DDS::DynamicData::DynamicData

DDS::DynamicDataTypeProperty_t::data

void DDS::DynamicDataTypeSupport::delete_data ( DynamicData^   a_data  ) 

void DDS::DynamicDataTypeSupport::copy_data ( DynamicData^   dest,
DynamicData^   source 
)

Deeply copy the given data samples.


RTI Data Distribution Service .Net APIs Version 4.5c Copyright © 9 Jun 2010 Real-Time Innovations, Inc