/*
  WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.

  This file was generated from test.idl using "rtiddsgen".
  The rtiddsgen tool is part of the RTI Data Distribution Service distribution.
  For more information, type 'rtiddsgen -help' at a command shell
  or consult the RTI Data Distribution Service manual.
*/

#include "testSupport.h"
#include "testPlugin.h"


using namespace System;
using namespace DDS;
    
/* ========================================================================= */

// ---------------------------------------------------------------------------
// TestData_tDataWriter
// ---------------------------------------------------------------------------

TestData_tDataWriter::TestData_tDataWriter(
        System::IntPtr impl) : DDS::TypedDataWriter<TestData_t^>(impl) {
    // empty
}


// ---------------------------------------------------------------------------
// TestData_tDataReader
// ---------------------------------------------------------------------------

TestData_tDataReader::TestData_tDataReader(
        System::IntPtr impl) : DDS::TypedDataReader<TestData_t^>(impl) {
    // empty
}


// ---------------------------------------------------------------------------
// TestData_tTypeSupport
// ---------------------------------------------------------------------------

TestData_tTypeSupport::TestData_tTypeSupport()
        : DDS::TypedTypeSupport<TestData_t^>(
            TestData_tPlugin::get_instance()) {

    _type_plugin = TestData_tPlugin::get_instance();
}

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

    get_instance()->register_type_untyped(participant, type_name);
}

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

    get_instance()->unregister_type_untyped(participant, type_name);
}

TestData_t^ TestData_tTypeSupport::create_data() {
    return gcnew TestData_t();
}

void TestData_tTypeSupport::delete_data(
        TestData_t^ a_data) {
    /* If the generated type does not implement IDisposable (the default),
     * the following will no a no-op.
     */
    delete a_data;
}

void TestData_tTypeSupport::print_data(TestData_t^ a_data) {
     get_instance()->_type_plugin->print_data(a_data, nullptr, 0);
}

void TestData_tTypeSupport::copy_data(
        TestData_t^ dst, TestData_t^ src) {

    get_instance()->copy_data_untyped(dst, src);
}

System::String^ TestData_tTypeSupport::get_type_name() {
    return TYPENAME;
}

DDS::DataReader^ TestData_tTypeSupport::create_datareaderI(
        System::IntPtr impl) {

    return gcnew TestData_tDataReader(impl);
}

DDS::DataWriter^ TestData_tTypeSupport::create_datawriterI(
        System::IntPtr impl) {

    return gcnew TestData_tDataWriter(impl);
}

TestData_tTypeSupport^
TestData_tTypeSupport::get_instance() {
    if (_singleton == nullptr) {
        _singleton = gcnew TestData_tTypeSupport();
    }
    return _singleton;
}
    