RTI Connext .Net APIs  Version 5.3.1
DDS::DynamicDataTypeSupport Class Reference

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

#include <managed_dynamicdata.h>

Inherits DDS::AbstractTypedTypeSupport< T >.

Public Member Functions

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

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

◆ DynamicDataTypeSupport()

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

Construct a new DDS::DynamicDataTypeSupport object.

This step is usually followed by type registration.

Parameters
typeThe DDS::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 DDS::DynamicDataTypeProperty_t.DYNAMIC_DATA_TYPE_PROPERTY_DEFAULT.
See also
DDS::DynamicDataTypeSupport::register_type
Exceptions
Oneof the Standard Return Codes

◆ ~DynamicDataTypeSupport()

virtual DDS::DynamicDataTypeSupport::~DynamicDataTypeSupport ( )
inlinevirtual

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

◆ is_valid()

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 Connext runs. Therefore, the implementation does not throw any exceptions in the constructor.

See also
DDS::DynamicDataTypeSupport::DynamicDataTypeSupport

◆ register_type()

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.

If the type cannot be registered, this will fail with DDS::Retcode_PreconditionNotMet or DDS::Retcode_OutOfResources.

See also
FooTypeSupport::register_type
DDS::DomainParticipant::create_topic
DDS::DynamicDataTypeSupport::unregister_type

Referenced by RTI.Connext.Queuing.QueueConsumer< TRep >::QueueConsumer().

◆ 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.

If the type cannot be unregistered, this will fail with DDS::Retcode_Error or DDS::Retcode_BadParameter.

See also
FooTypeSupport::unregister_type
DDS::DynamicDataTypeSupport::register_type

◆ get_type_name()

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

◆ get_data_type()

TypeCode ^ DDS::DynamicDataTypeSupport::get_data_type ( )

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

◆ create_data()

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

Referenced by RTI.Connext.Queuing.QueueConsumer< TRep >::QueueConsumer().

◆ delete_data()

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

◆ copy_data()

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

Deeply copy the given data samples.

◆ to_cdr_buffer()

void DDS::DynamicDataTypeSupport::to_cdr_buffer ( ByteSeq sequence,
DynamicData data 
)

Serializes the specified DynamicData object into a sequence of octets.

This method is an overloaded version of 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 DDS::DynamicData::to_cdr_buffer method, except that it receives the DynamicData object to be serialized and a ByteSeq as output.

This method may resize sequence as needed to fit the serialized dynamicData object.

See also
DDS::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

◆ from_cdr_buffer()

void DDS::DynamicDataTypeSupport::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 DDS::DynamicData::from_cdr_buffer method, except that it receives the DynamicData object that contains the result of the deserialization, and a ByteSeq as deserialization input.

See also
DDS::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

RTI Connext .Net APIs Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc