RTI Connext .NET API (legacy)  Version 6.1.1
HelloWorldSupport.cpp

User Data Type Support

Files generated by rtiddsgen that implement the type specific APIs required by the DDS specification, as described in the User Data Type Support, where:

The following files are always generated in the C++/CLI language, even when code is generated with the -language C# option, because they depend on unmanaged code that ships with RTI Connext. Once compiled, the code can be used from either C++/CLI or C# code; see the C# publisher and subscriber example code.

HelloWorldSupport.h

/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from HelloWorld.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext DDS distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the Code Generator User's Manual.
*/
#pragma once
#include "HelloWorld.h"
class DDSDataWriter;
class DDSDataReader;
// ---------------------------------------------------------------------------
// HelloWorldTypeSupport
// ---------------------------------------------------------------------------
ref class HelloWorldPlugin;
/* A collection of useful methods for dealing with objects of type
* HelloWorld.
*/
public ref class HelloWorldTypeSupport
: public DDS::TypedTypeSupport<HelloWorld^> {
// --- Type name: --------------------------------------------------------
public:
static System::String^ TYPENAME = "HelloWorld";
// --- Public Methods: ---------------------------------------------------
public:
/* Get the default name of this type.
*
* An application can choose to register a type under any name, so
* calling this method is strictly optional.
*/
static System::String^ get_type_name();
/* Register this type with the given participant under the given logical
* name. This type must be registered before a Topic can be created that
* uses it.
*/
static void register_type(
DDS::DomainParticipant^ participant,
System::String^ type_name);
/* Unregister this type from the given participant, where it was
* previously registered under the given name. No further Topic creation
* using this type will be possible.
*
* Unregistration allows some middleware resources to be reclaimed.
*/
static void unregister_type(
DDS::DomainParticipant^ participant,
System::String^ type_name);
/* Create an instance of the HelloWorld type.
*/
static HelloWorld^ create_data();
/* If instances of the HelloWorld type require any
* explicit finalization, perform it now on the given sample.
*/
static void delete_data(HelloWorld^ data);
/* Write the contents of the data sample to standard out.
*/
static void print_data(HelloWorld^ a_data);
/* Perform a deep copy of the contents of one data sample over those of
* another, overwriting it.
*/
static void copy_data(
HelloWorld^ dst_data,
HelloWorld^ src_data);
static void serialize_data_to_cdr_buffer(
array<System::Byte>^ buffer,
System::UInt32% length,
HelloWorld^ a_data,
System::Int16 representation);
static void serialize_data_to_cdr_buffer(
array<System::Byte>^ buffer,
System::UInt32% length,
HelloWorld^ a_data);
static void deserialize_data_from_cdr_buffer(
HelloWorld^ a_data,
array<System::Byte>^ buffer,
System::UInt32 length);
#ifndef NDDS_STANDALONE_TYPE
static System::String^ data_to_string(
HelloWorld ^sample,
PrintFormatProperty ^property);
static System::String^ data_to_string(
HelloWorld ^sample);
#endif
static DDS::TypeCode^ get_typecode();
// --- Implementation: ---------------------------------------------------
/* The following code is for the use of the middleware infrastructure.
* Applications are not expected to call it directly.
*/
public:
virtual System::String^ get_type_name_untyped() override;
virtual DDS::DataReader^ create_datareaderI(
System::IntPtr impl) override;
virtual DDS::DataWriter^ create_datawriterI(
System::IntPtr impl) override;
virtual HelloWorld^ create_data_untyped() override;
public:
static HelloWorldTypeSupport^ get_instance();
HelloWorldTypeSupport();
private:
static HelloWorldTypeSupport^ _singleton;
HelloWorldPlugin^ _type_plugin;
};
// ---------------------------------------------------------------------------
// HelloWorldDataReader
// ---------------------------------------------------------------------------
public ref class HelloWorldDataReader :
public DDS::TypedDataReader<HelloWorld^> {
/* The following code is for the use of the middleware infrastructure.
* Applications are not expected to call it directly.
*/
internal:
HelloWorldDataReader(System::IntPtr impl);
};
// ---------------------------------------------------------------------------
// HelloWorldDataWriter
// ---------------------------------------------------------------------------
public ref class HelloWorldDataWriter :
public DDS::TypedDataWriter<HelloWorld^> {
/* The following code is for the use of the middleware infrastructure.
* Applications are not expected to call it directly.
*/
internal:
HelloWorldDataWriter(System::IntPtr impl);
};

HelloWorldSupport.cpp

/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from HelloWorld.idl
using RTI Code Generator (rtiddsgen) version 3.1.1.
The rtiddsgen tool is part of the RTI Connext DDS distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the Code Generator User's Manual.
*/
#include "HelloWorldSupport.h"
#include "HelloWorldPlugin.h"
#pragma unmanaged
#include "ndds/ndds_cpp.h"
#pragma managed
using namespace System;
using namespace DDS;
/* ========================================================================= */
// ---------------------------------------------------------------------------
// HelloWorldDataWriter
// ---------------------------------------------------------------------------
HelloWorldDataWriter::HelloWorldDataWriter(
System::IntPtr impl) : DDS::TypedDataWriter<HelloWorld^>(impl) {
// empty
}
// ---------------------------------------------------------------------------
// HelloWorldDataReader
// ---------------------------------------------------------------------------
HelloWorldDataReader::HelloWorldDataReader(
System::IntPtr impl) : DDS::TypedDataReader<HelloWorld^>(impl) {
// empty
}
// ---------------------------------------------------------------------------
// HelloWorldTypeSupport
// ---------------------------------------------------------------------------
HelloWorldTypeSupport::HelloWorldTypeSupport()
: DDS::TypedTypeSupport<HelloWorld^>(
HelloWorldPlugin::get_instance()) {
_type_plugin = HelloWorldPlugin::get_instance();
}
void HelloWorldTypeSupport::register_type(
DDS::DomainParticipant^ participant,
System::String^ type_name) {
get_instance()->register_type_untyped(participant, type_name);
}
void HelloWorldTypeSupport::unregister_type(
DDS::DomainParticipant^ participant,
System::String^ type_name) {
get_instance()->unregister_type_untyped(participant, type_name);
}
HelloWorld^ HelloWorldTypeSupport::create_data() {
return gcnew HelloWorld();
}
HelloWorld^ HelloWorldTypeSupport::create_data_untyped() {
return create_data();
}
void HelloWorldTypeSupport::delete_data(
HelloWorld^ a_data) {
/* If the generated type does not implement IDisposable (the default),
* the following will no a no-op.
*/
delete a_data;
}
void HelloWorldTypeSupport::print_data(HelloWorld^ a_data) {
get_instance()->_type_plugin->print_data(a_data, nullptr, 0);
}
void HelloWorldTypeSupport::copy_data(
HelloWorld^ dst, HelloWorld^ src) {
get_instance()->copy_data_untyped(dst, src);
}
void HelloWorldTypeSupport::serialize_data_to_cdr_buffer(
array<System::Byte>^ buffer,
System::UInt32% length,
HelloWorld^ a_data,
System::Int16 representation)
{
if (!get_instance()->_type_plugin->serialize_to_cdr_buffer(
buffer,
length,
a_data,
representation)) {
throw gcnew Retcode_Error(DDS_RETCODE_ERROR);
}
}
void HelloWorldTypeSupport::serialize_data_to_cdr_buffer(
array<System::Byte>^ buffer,
System::UInt32% length,
HelloWorld^ a_data)
{
if (!get_instance()->_type_plugin->serialize_to_cdr_buffer(buffer,length,a_data)) {
throw gcnew Retcode_Error(DDS_RETCODE_ERROR);
}
}
void HelloWorldTypeSupport::deserialize_data_from_cdr_buffer(
HelloWorld^ a_data,
array<System::Byte>^ buffer,
System::UInt32 length)
{
if (!get_instance()->_type_plugin->deserialize_from_cdr_buffer(a_data,buffer,length)) {
throw gcnew Retcode_Error(DDS_RETCODE_ERROR);
}
}
#ifndef NDDS_STANDALONE_TYPE
System::String^ HelloWorldTypeSupport::data_to_string(
HelloWorld ^sample,
PrintFormatProperty ^formatProperty)
{
return get_instance()->_type_plugin->data_to_string(
sample,
formatProperty);
}
System::String^ HelloWorldTypeSupport::data_to_string(
HelloWorld ^sample)
{
PrintFormatProperty ^formatProperty = gcnew PrintFormatProperty();
return get_instance()->_type_plugin->data_to_string(
sample,
formatProperty);
}
#endif
DDS::TypeCode^ HelloWorldTypeSupport::get_typecode() {
#ifndef NDDS_STANDALONE_TYPE
return HelloWorld::get_typecode();
#else
return nullptr;
#endif
}
System::String^ HelloWorldTypeSupport::get_type_name() {
return TYPENAME;
}
System::String^ HelloWorldTypeSupport::get_type_name_untyped() {
return TYPENAME;
}
DDS::DataReader^ HelloWorldTypeSupport::create_datareaderI(
System::IntPtr impl) {
return gcnew HelloWorldDataReader(impl);
}
DDS::DataWriter^ HelloWorldTypeSupport::create_datawriterI(
System::IntPtr impl) {
return gcnew HelloWorldDataWriter(impl);
}
HelloWorldTypeSupport^
HelloWorldTypeSupport::get_instance() {
if (_singleton == nullptr) {
_singleton = gcnew HelloWorldTypeSupport();
}
return _singleton;
}