RTI Connext .NET API (legacy)
Version 6.1.2
|
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... | |
TypeCode ^ | get_data_type () |
Get the DDS::TypeCode wrapped by this DDS::DynamicDataTypeSupport. More... | |
DynamicData ^ | create_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 CDR sequence of octets. More... | |
void | to_cdr_buffer (ByteSeq^ sequence, DynamicData^ data, System::Int16 representation) |
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... | |
A factory for registering a dynamically defined type and creating DDS::DynamicData objects.
A DDS::DynamicDataTypeSupport has three roles:
DDS::DynamicDataTypeSupport::DynamicDataTypeSupport | ( | TypeCode^ | type, |
DynamicDataTypeProperty_t^ | props | ||
) |
Construct a new DDS::DynamicDataTypeSupport object.
This step is usually followed by type registration.
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. |
One | of the Standard Return Codes |
|
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.
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.
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 function will fail with DDS::Retcode_PreconditionNotMet or DDS::Retcode_OutOfResources.
Referenced by RTI.Connext.Queuing.QueueConsumer< TRep >::QueueConsumer().
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 function will fail with DDS::Retcode_Error or DDS::Retcode_BadParameter.
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#:
In C++/CLI:
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#:
In C++/CLI:
Referenced by RTI.Connext.Queuing.QueueConsumer< TRep >::QueueConsumer().
void DDS::DynamicDataTypeSupport::delete_data | ( | DynamicData^ | a_data | ) |
Finalize and deallocate the DDS::DynamicData sample.
Referenced by RTI.Connext.Queuing.QueueConsumer< TRep >::SendAvailability().
void DDS::DynamicDataTypeSupport::copy_data | ( | DynamicData^ | dest, |
DynamicData^ | source | ||
) |
Deeply copy the given data samples.
void DDS::DynamicDataTypeSupport::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 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.
sequence | <<out>>. Serialization byte sequence. |
data | <<in>>. The DynamicData object to be serialized. Cannot be null. |
One | of the Standard Return Codes |
void DDS::DynamicDataTypeSupport::to_cdr_buffer | ( | ByteSeq^ | sequence, |
DynamicData^ | data, | ||
System::Int16 | 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 DDS::DynamicData::to_cdr_buffer method, except that it receives the DynamicData object to be serialized and a 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 |
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.
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 |