diff options
Diffstat (limited to 'modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender')
4 files changed, 315 insertions, 0 deletions
diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.idl new file mode 100644 index 00000000000..6fdd94e698c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_STATE_CONNECTION_TEST_SENDER_IDL +#define DDS_STATE_CONNECTION_TEST_SENDER_IDL + +#include "Connector/State_Connection_Test_Connector.idl" + +module State_Connection_Test +{ + component Sender + { + port CCM_DDS::State_ConnectionTest::DDS_Update info_update; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.mpc new file mode 100644 index 00000000000..97b11af7e00 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SCT_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_SCT_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SCT_Connector_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_STUB_Export \ + -Wb,stub_export_include=Sender_stub_export.h \ + -Wb,skel_export_macro=SENDER_SVNT_Export \ + -Wb,skel_export_include=Sender_svnt_export.h \ + -Wb,svnt_export_macro=SENDER_SVNT_Export \ + -Wb,svnt_export_include=Sender_svnt_export.h \ + -Wb,exec_export_macro=SENDER_EXEC_Export \ + -Wb,exec_export_include=Sender_exec_export.h \ + -I .. + + IDL_Files { + State_Connection_Test_Sender.idl + } +} + +project(DDS_SCT_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SCT_Sender_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_LEM_STUB_Export \ + -Wb,stub_export_include=Sender_lem_stub_export.h \ + -SS -Gxhst -I $CIAO_ROOT/connectors -I .. + + IDL_Files { + State_Connection_Test_SenderE.idl + } +} + +project(DDS_SCT_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SCT_Sender_lem_gen DDS_SCT_Sender_stub DDS_SCT_Base_stub + libs += DDS_SCT_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_SenderEC.cpp + } + + Header_Files { + State_Connection_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + State_Connection_Test_SenderEC.inl + } +} + +project(DDS_SCT_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_SCT_Sender_idl_gen DDS_SCT_Base_stub DDS_SCT_Connector_stub + libs += DDS_SCT_Base_stub DDS_SCT_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_SenderC.cpp + } + + Header_Files { + State_Connection_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + State_Connection_Test_SenderC.inl + } +} + +project(DDS_SCT_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_SCT_Sender_lem_stub DDS_SCT_Sender_stub DDS_SCT_Connector_lem_stub DDS_SCT_Connector_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_SCT_Base_stub DDS_SCT_Connector_lem_stub DDS_SCT_Connector_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_Sender_exec.cpp + } + + Header_Files { + State_Connection_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SCT_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SCT_Base_stub DDS_SCT_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SCT_Connector_stub DDS_SCT_Connector_svnt DDS_SCT_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_SCT_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SCT_Connector_stub DDS_SCT_Connector_svnt DDS_SCT_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_SenderS.cpp + State_Connection_Test_Sender_svnt.cpp + } + + Header_Files { + State_Connection_Test_SenderS.h + State_Connection_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + State_Connection_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.cpp new file mode 100644 index 00000000000..8c7b8d82c1a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.cpp @@ -0,0 +1,100 @@ +// -*- C++ -*- +// $Id$ + +#include "State_Connection_Test_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_State_Connection_Test_Sender_Impl +{ + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + + Sender_exec_i::Sender_exec_i (void) + : updater_ok_ (false), + updater_dds_datawriter_ok_ (false) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::State_Connection_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->updater_ = + this->context_->get_connection_info_update_data (); + if (! ::CORBA::is_nil (this->updater_)) + { + this->updater_ok_ = true; + } + this->updater_dds_datawriter_ = + this->context_->get_connection_info_update_dds_entity (); + if (! ::CORBA::is_nil (this->updater_dds_datawriter_)) + { + this->updater_dds_datawriter_ok_ = true; + } + } + + void + Sender_exec_i::ccm_activate (void) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if (!this->updater_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Sender : get updater failed\n"))); + } + else + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Sender : Get updater passed\n"))); + } + if (!this->updater_dds_datawriter_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Sender : Get dds writer for DDS_Updater failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender : Get dds writer for DDS_Updater passed\n"))); + } + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_State_Connection_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.h new file mode 100644 index 00000000000..3835b874c21 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.h @@ -0,0 +1,52 @@ +// -*- C++ -*- +// $Id$ + +#ifndef STATE_CONNECTION_SENDER_EXEC_H_ +#define STATE_CONNECTION_SENDER_EXEC_H_ + + +#include "State_Connection_Test_SenderEC.h" + +#include /**/ "Sender_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +#include <map> + +namespace CIAO_State_Connection_Test_Sender_Impl +{ + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (void); + + virtual void set_session_context (::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::State_Connection_Test::CCM_Sender_Context_var context_; + CCM_DDS::State_ConnectionTest::Updater_var updater_; + DDS::DataWriter_var updater_dds_datawriter_; + + bool updater_ok_; + bool updater_dds_datawriter_ok_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_State_Connection_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + |