diff options
author | msmit <msmit@remedy.nl> | 2011-06-17 11:25:52 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2011-06-17 11:25:52 +0000 |
commit | 09a004e463d980affbc4b2372bc7359bf8decde4 (patch) | |
tree | 1dd59b0743d32fa0e047253035d4b417d3fc15a0 | |
parent | 3749fa970e93793fd389da7dbb74d75aee6e5849 (diff) | |
download | ATCD-09a004e463d980affbc4b2372bc7359bf8decde4.tar.gz |
Fri Jun 17 11:23:32 UTC 2011 Marcel Smit <msmit@remedy.nl>
* examples/Hello/Hello_Base/Hello_Base.mpc:
* examples/Hello/Receiver/Receiver.idl:
* examples/Hello/Receiver/Receiver.mpc:
* examples/Hello/Receiver/Receiver_exec.h:
* examples/Hello/Receiver/Receiver_exec.cpp:
* examples/Hello/Sender/Sender.idl:
* examples/Hello/Sender/Sender.mpc:
* examples/Hello/Sender/Sender_exec.h:
* examples/Hello/Sender/Sender_exec.cpp:
* examples/Hello/descriptors/DeploymentPlan.cdp:
* examples/Hello/descriptors/DeploymentPlan_without_ns.cdp:
* examples/Hello/step-by-step.html:
Rewritten. Regenerated the mpc and executor code. Also
using unhomed components. Next step is to test and change
the other perl scripts.
-rw-r--r-- | CIAO/ChangeLog | 18 | ||||
-rw-r--r-- | CIAO/examples/Hello/Hello_Base/Hello_Base.mpc | 60 | ||||
-rw-r--r-- | CIAO/examples/Hello/Receiver/Receiver.idl | 3 | ||||
-rw-r--r-- | CIAO/examples/Hello/Receiver/Receiver.mpc | 114 | ||||
-rw-r--r-- | CIAO/examples/Hello/Receiver/Receiver_exec.cpp | 78 | ||||
-rw-r--r-- | CIAO/examples/Hello/Receiver/Receiver_exec.h | 93 | ||||
-rw-r--r-- | CIAO/examples/Hello/Sender/Sender.idl | 4 | ||||
-rw-r--r-- | CIAO/examples/Hello/Sender/Sender.mpc | 101 | ||||
-rw-r--r-- | CIAO/examples/Hello/Sender/Sender_exec.cpp | 130 | ||||
-rw-r--r-- | CIAO/examples/Hello/Sender/Sender_exec.h | 132 | ||||
-rw-r--r-- | CIAO/examples/Hello/descriptors/DeploymentPlan.cdp | 199 | ||||
-rw-r--r-- | CIAO/examples/Hello/descriptors/DeploymentPlan_without_ns.cdp | 141 | ||||
-rw-r--r-- | CIAO/examples/Hello/step-by-step.html | 251 |
13 files changed, 552 insertions, 772 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 508b431fd89..3b0b738d013 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,21 @@ +Fri Jun 17 11:23:32 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * examples/Hello/Hello_Base/Hello_Base.mpc: + * examples/Hello/Receiver/Receiver.idl: + * examples/Hello/Receiver/Receiver.mpc: + * examples/Hello/Receiver/Receiver_exec.h: + * examples/Hello/Receiver/Receiver_exec.cpp: + * examples/Hello/Sender/Sender.idl: + * examples/Hello/Sender/Sender.mpc: + * examples/Hello/Sender/Sender_exec.h: + * examples/Hello/Sender/Sender_exec.cpp: + * examples/Hello/descriptors/DeploymentPlan.cdp: + * examples/Hello/descriptors/DeploymentPlan_without_ns.cdp: + * examples/Hello/step-by-step.html: + Rewritten. Regenerated the mpc and executor code. Also + using unhomed components. Next step is to test and change + the other perl scripts. + Thu Jun 16 11:05:53 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl> * connectors/ami4ccm/examples/Quoter/Producer/Quoter_Producer_exec.cpp: diff --git a/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc b/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc index 34b0f7d2316..11466cca696 100644 --- a/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc +++ b/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc @@ -1,31 +1,63 @@ // $Id$ -// This file is generated with "generate_component_mpc.pl -n Hello_Base" +// This file is generated with "generate_component_mpc.pl -n -l../lib -o../lib Hello_Base" -project(Hello_Base_idl_gen) : componentidldefaults, avoids_ccm_noevent { +project(Hello_Base_idl_gen) : componentidldefaults { custom_only = 1 + idlflags += -Wb,stub_export_macro=HELLO_BASE_STUB_Export \ -Wb,stub_export_include=Hello_Base_stub_export.h \ -Wb,skel_export_macro=HELLO_BASE_SKEL_Export \ - -Wb,skel_export_include=Hello_Base_skel_export.h + -Wb,skel_export_include=Hello_Base_skel_export.h \ + -Gxhex -Gxhsk -Gxhst IDL_Files { Hello_Base.idl } } -project(Hello_Base_lem_gen) : ciaoidldefaults, avoids_ccm_noevent { - custom_only = 1 +project(Hello_Base_lem_gen) : ciaoidldefaults { after += Hello_Base_idl_gen - idlflags += -Wb,export_macro=HELLO_BASE_STUB_Export \ - -Wb,export_include=Hello_Base_stub_export.h + custom_only = 1 + idlflags += -Wb,stub_export_macro=HELLO_BASE_LEM_STUB_Export \ + -Wb,stub_export_include=Hello_Base_lem_stub_export.h \ + -SS -Gxhst IDL_Files { Hello_BaseE.idl } } -project(Hello_Base_stub) : ccm_stub,avoids_ccm_noevent { - after += Hello_Base_lem_gen +project(Hello_Base_lem_stub) : ccm_svnt { + after += Hello_Base_lem_gen Hello_Base_stub + libs += Hello_Base_stub + + libpaths += ../lib + libout = ../lib + sharedname = Hello_Base_lem_stub + dynamicflags += HELLO_BASE_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Hello_BaseEC.cpp + } + + Header_Files { + Hello_BaseEC.h + Hello_Base_lem_stub_export.h + } + + Inline_Files { + Hello_BaseEC.inl + } +} + +project(Hello_Base_stub) : ccm_stub { + after += Hello_Base_idl_gen + libs += + + libpaths += ../lib libout = ../lib sharedname = Hello_Base_stub dynamicflags += HELLO_BASE_STUB_BUILD_DLL @@ -35,7 +67,6 @@ project(Hello_Base_stub) : ccm_stub,avoids_ccm_noevent { Source_Files { Hello_BaseC.cpp - Hello_BaseEC.cpp } Header_Files { @@ -49,13 +80,14 @@ project(Hello_Base_stub) : ccm_stub,avoids_ccm_noevent { } -project(Hello_Base_skel) : ccm_svnt, avoids_ccm_noevent { - after += Hello_Base_stub +project(Hello_Base_skel) : ciao_executor { + after += Hello_Base_stub Hello_Base_lem_stub sharedname = Hello_Base_skel libs += Hello_Base_stub - libout = ../lib - libpaths += ../lib + + libpaths += ../lib + libout = ../lib dynamicflags += HELLO_BASE_SKEL_BUILD_DLL IDL_Files { diff --git a/CIAO/examples/Hello/Receiver/Receiver.idl b/CIAO/examples/Hello/Receiver/Receiver.idl index c43910e1874..92ae30acb36 100644 --- a/CIAO/examples/Hello/Receiver/Receiver.idl +++ b/CIAO/examples/Hello/Receiver/Receiver.idl @@ -15,8 +15,5 @@ module Hello attribute short iterations; }; - home ReceiverHome manages Receiver - { - }; }; #endif /*RECEIVER_IDL*/ diff --git a/CIAO/examples/Hello/Receiver/Receiver.mpc b/CIAO/examples/Hello/Receiver/Receiver.mpc index 5c834c4b4ac..0242c4997d9 100644 --- a/CIAO/examples/Hello/Receiver/Receiver.mpc +++ b/CIAO/examples/Hello/Receiver/Receiver.mpc @@ -1,142 +1,140 @@ // $Id$ -// This file is generated with "generate_component_mpc.pl Receiver" +// This file is generated with "generate_component_mpc.pl -l ../lib -o ../lib -p Hello_Base Receiver" -project(Hello_Receiver_idl_gen) : componentidldefaults, avoids_ccm_noevent { +project(Hello_Base_Receiver_idl_gen) : componentidldefaults { custom_only = 1 - after += Hello_Base_idl_gen + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ -Wb,stub_export_include=Receiver_stub_export.h \ - -Wb,skel_export_macro=RECEIVER_SKEL_Export \ - -Wb,skel_export_include=Receiver_skel_export.h \ - -Wb,svnt_export_macro=RECEIVER_SVNT_Export \ - -Wb,svnt_export_include=Receiver_svnt_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h \ -Wb,exec_export_macro=RECEIVER_EXEC_Export \ - -Wb,exec_export_include=Receiver_exec_export.h + -Wb,exec_export_include=Receiver_exec_export.h \ + -Gxhex -Gxhsk -Gxhst IDL_Files { Receiver.idl } } -project(Hello_Receiver_lem_gen) : ciaoidldefaults , avoids_ccm_noevent{ +project(Hello_Base_Receiver_lem_gen) : ciaoidldefaults { + after += Hello_Base_Receiver_idl_gen custom_only = 1 - after += Hello_Receiver_idl_gen - idlflags += -Wb,export_macro=RECEIVER_EXEC_Export \ - -Wb,export_include=Receiver_exec_export.h \ - -SS + idlflags += -Wb,stub_export_macro=RECEIVER_LEM_STUB_Export \ + -Wb,stub_export_include=Receiver_lem_stub_export.h \ + -SS -Gxhst IDL_Files { ReceiverE.idl } } -project(Hello_Receiver_stub) : ccm_stub, avoids_ccm_noevent { - after += Hello_Receiver_idl_gen Hello_Base_stub - libs += Hello_Base_stub - libout = ../lib - libpaths += ../lib +project(Hello_Base_Receiver_lem_stub) : ccm_svnt { + after += Hello_Base_Receiver_lem_gen Hello_Base_Receiver_stub Hello_Base_stub Hello_Base_lem_stub + libs += Hello_Base_stub Hello_Base_lem_stub Receiver_stub - sharedname = Hello_Receiver_stub - dynamicflags += RECEIVER_STUB_BUILD_DLL + libpaths += ../lib + libout = ../lib + sharedname = Receiver_lem_stub + dynamicflags += RECEIVER_LEM_STUB_BUILD_DLL IDL_Files { } Source_Files { - ReceiverC.cpp + ReceiverEC.cpp } Header_Files { - ReceiverC.h - Receiver_stub_export.h + ReceiverEC.h + Receiver_lem_stub_export.h } Inline_Files { - ReceiverC.inl + ReceiverEC.inl } } -project(Hello_Receiver_exec) : ciao_executor, avoids_ccm_noevent { - after += Hello_Receiver_lem_gen Hello_Receiver_stub - sharedname = Hello_Receiver_exec - libs += Hello_Receiver_stub Hello_Base_stub - libout = ../lib - libpaths += ../lib +project(Hello_Base_Receiver_stub) : ccm_stub { + after += Hello_Base_Receiver_idl_gen Hello_Base_stub Hello_Base_lem_stub + libs += Hello_Base_stub Hello_Base_lem_stub - dynamicflags += RECEIVER_EXEC_BUILD_DLL + libpaths += ../lib + libout = ../lib + sharedname = Receiver_stub + dynamicflags += RECEIVER_STUB_BUILD_DLL IDL_Files { } Source_Files { - ReceiverEC.cpp - Receiver_exec.cpp + ReceiverC.cpp } Header_Files { - ReceiverEC.h - Receiver_exec.h - Receiver_exec_export.h + ReceiverC.h + Receiver_stub_export.h } Inline_Files { - ReceiverEC.inl + ReceiverC.inl } } -project(Hello_Receiver_skel) : ccm_svnt , avoids_ccm_noevent{ - after += Hello_Base_skel Hello_Receiver_stub - sharedname = Hello_Receiver_skel - libs += Hello_Receiver_stub \ - Hello_Base_skel \ - Hello_Base_stub - libout = ../lib +project(Hello_Base_Receiver_exec) : ciao_executor { + after += Hello_Base_lem_stub Hello_Base_Receiver_lem_stub Hello_Base_Receiver_stub + sharedname = Receiver_exec + libs += Hello_Base_lem_stub Receiver_stub Receiver_lem_stub Hello_Base_stub Hello_Base_lem_stub + libpaths += ../lib - dynamicflags += RECEIVER_SKEL_BUILD_DLL + libout = ../lib + dynamicflags += RECEIVER_EXEC_BUILD_DLL IDL_Files { } Source_Files { - ReceiverS.cpp + Receiver_exec.cpp } Header_Files { - ReceiverS.h - Receiver_skel_export.h + Receiver_exec.h + Receiver_exec_export.h } Inline_Files { - ReceiverS.inl } } -project(Hello_Receiver_svnt) : ciao_servant, avoids_ccm_noevent { - after += Hello_Receiver_skel Hello_Receiver_exec - sharedname = Hello_Receiver_svnt - libs += Hello_Receiver_exec \ - Hello_Receiver_skel \ - Hello_Receiver_stub \ + +project(Hello_Base_Receiver_svnt) : ciao_servant { + after += Hello_Base_skel Hello_Base_lem_stub Hello_Base_Receiver_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub \ Hello_Base_skel \ - Hello_Base_stub - libout = ../lib - libpaths += ../lib + Hello_Base_stub \ + Hello_Base_lem_stub + libpaths += ../lib + libout = ../lib dynamicflags += RECEIVER_SVNT_BUILD_DLL IDL_Files { } Source_Files { + ReceiverS.cpp Receiver_svnt.cpp } Header_Files { + ReceiverS.h Receiver_svnt.h Receiver_svnt_export.h } Inline_Files { + ReceiverS.inl } } diff --git a/CIAO/examples/Hello/Receiver/Receiver_exec.cpp b/CIAO/examples/Hello/Receiver/Receiver_exec.cpp index 67fa04e1fd8..8c6c4275691 100644 --- a/CIAO/examples/Hello/Receiver/Receiver_exec.cpp +++ b/CIAO/examples/Hello/Receiver/Receiver_exec.cpp @@ -1,7 +1,8 @@ +// -*- C++ -*- // $Id$ /** - * Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.6 + * Code generated by the The ACE ORB (TAO) IDL Compiler v2.0.2 * TAO and the TAO IDL Compiler have been developed by: * Center for Distributed Object Computing * Washington University @@ -13,7 +14,6 @@ * University of California at Irvine * Irvine, CA * USA - * http://doc.ece.uci.edu/ * and * Institute for Software Integrated Systems * Vanderbilt University @@ -25,17 +25,14 @@ * http://www.cs.wustl.edu/~schmidt/TAO.html **/ -// TAO_IDL - Generated from -// .\be\be_codegen.cpp:1278 - #include "Receiver_exec.h" -#include "ace/OS_NS_unistd.h" namespace CIAO_Hello_Receiver_Impl { - //============================================================ - // Component Executor Implementation Class: Receiver_exec_i - //============================================================ + + /** + * Component Executor Implementation Class: Receiver_exec_i + */ Receiver_exec_i::Receiver_exec_i (void) : iterations_ (10) @@ -58,7 +55,7 @@ namespace CIAO_Hello_Receiver_Impl ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver - Informed by the Sender with message [%C]\n"), ev->data ())); - Hello::ReadMessage_var rev = this->context_->get_connection_read_message (); + Hello::ReadMessage_var rev = this->ciao_context_->get_connection_read_message (); if (CORBA::is_nil (rev.in ())) throw CORBA::BAD_INV_ORDER (); for (CORBA::Short i = 0; i < this->iterations_; ++i) @@ -75,15 +72,13 @@ namespace CIAO_Hello_Receiver_Impl ::CORBA::Short Receiver_exec_i::iterations (void) { - /* Your code here. */ return this->iterations_; } void Receiver_exec_i::iterations ( - ::CORBA::Short iterations) + const ::CORBA::Short iterations) { - /* Your code here. */ this->iterations_ = iterations; } @@ -93,12 +88,10 @@ namespace CIAO_Hello_Receiver_Impl Receiver_exec_i::set_session_context ( ::Components::SessionContext_ptr ctx) { - ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::set_session_context\n")); - - this->context_ = + this->ciao_context_ = ::Hello::CCM_Receiver_Context::_narrow (ctx); - if ( ::CORBA::is_nil (this->context_.in ())) + if ( ::CORBA::is_nil (this->ciao_context_.in ())) { throw ::CORBA::INTERNAL (); } @@ -146,54 +139,3 @@ namespace CIAO_Hello_Receiver_Impl return retval; } } - -namespace CIAO_Hello_Receiver_Impl -{ - //============================================================ - // Home Executor Implementation Class: ReceiverHome_exec_i - //============================================================ - - ReceiverHome_exec_i::ReceiverHome_exec_i (void) - { - } - - ReceiverHome_exec_i::~ReceiverHome_exec_i (void) - { - } - - // All operations and attributes. - - // Factory operations. - - // Finder operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - ReceiverHome_exec_i::create (void) - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - Receiver_exec_i, - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Hello_ReceiverHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_NORETURN ( - retval, - ReceiverHome_exec_i); - - return retval; - } -} - diff --git a/CIAO/examples/Hello/Receiver/Receiver_exec.h b/CIAO/examples/Hello/Receiver/Receiver_exec.h index c59b471ac9a..3d13c3a5e0a 100644 --- a/CIAO/examples/Hello/Receiver/Receiver_exec.h +++ b/CIAO/examples/Hello/Receiver/Receiver_exec.h @@ -2,7 +2,7 @@ // $Id$ /** - * Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.6 + * Code generated by the The ACE ORB (TAO) IDL Compiler v2.0.2 * TAO and the TAO IDL Compiler have been developed by: * Center for Distributed Object Computing * Washington University @@ -14,7 +14,6 @@ * University of California at Irvine * Irvine, CA * USA - * http://doc.ece.uci.edu/ * and * Institute for Software Integrated Systems * Vanderbilt University @@ -25,13 +24,10 @@ * Information about TAO is available at: * http://www.cs.wustl.edu/~schmidt/TAO.html **/ +#ifndef CIAO_RECEIVER_EXEC_RZ2R5K_H_ +#define CIAO_RECEIVER_EXEC_RZ2R5K_H_ -// TAO_IDL - Generated from -// .\be\be_codegen.cpp:1217 - -#ifndef CIAO_RECEIVER_EXEC_H_ -#define CIAO_RECEIVER_EXEC_H_ - +#include /**/ "ace/pre.h" #include "ReceiverEC.h" @@ -42,10 +38,14 @@ #include /**/ "Receiver_exec_export.h" #include "tao/LocalObject.h" - namespace CIAO_Hello_Receiver_Impl { - class RECEIVER_EXEC_Export Receiver_exec_i + + /** + * Component Executor Implementation Class: Receiver_exec_i + */ + + class Receiver_exec_i : public virtual Receiver_Exec, public virtual ::CORBA::LocalObject { @@ -53,84 +53,61 @@ namespace CIAO_Hello_Receiver_Impl Receiver_exec_i (void); virtual ~Receiver_exec_i (void); + /** @name Supported operations and attributes. */ //@{ - /** Supported operations and attributes. */ //@} + /** @name Component attributes and port operations. */ //@{ - /** Component attributes and port operations. */ - virtual void push_click_in ( ::Hello::TimeOut * ev); - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_operation/operation_ch.cpp:42 - - virtual ::CORBA::Short - iterations (void); - - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_operation/operation_ch.cpp:42 + virtual ::CORBA::Short iterations (void); - virtual void - iterations ( - ::CORBA::Short iterations); + virtual void iterations (::CORBA::Short iterations); //@} + /** @name Operations from Components::SessionComponent. */ //@{ - /** Operations from Components::SessionComponent. */ - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - + 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); //@} + /** @name User defined public operations. */ + //@{ - private: - ::Hello::CCM_Receiver_Context_var context_; - CORBA::String_var message_; - CORBA::Short iterations_; - }; - - extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr - create_Hello_Receiver_Impl (void); -} + //@} -namespace CIAO_Hello_Receiver_Impl -{ - class RECEIVER_EXEC_Export ReceiverHome_exec_i - : public virtual ReceiverHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - ReceiverHome_exec_i (void); + private: + ::Hello::CCM_Receiver_Context_var ciao_context_; - virtual ~ReceiverHome_exec_i (void); + /** @name Component attributes. */ + //@{ - // All operations and attributes. + ::CORBA::Short iterations_; + //@} - // Factory operations. + /** @name User defined members. */ + //@{ - // Finder operations. + //@} - // Implicit operations. + /** @name User defined private operations. */ + //@{ - virtual ::Components::EnterpriseComponent_ptr - create (void); + //@} }; - extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Hello_ReceiverHome_Impl (void); + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Hello_Receiver_Impl (void); } -#endif /* ifndef */ +#include /**/ "ace/post.h" +#endif /* ifndef */ diff --git a/CIAO/examples/Hello/Sender/Sender.idl b/CIAO/examples/Hello/Sender/Sender.idl index 7531e19eddd..edf43943bfc 100644 --- a/CIAO/examples/Hello/Sender/Sender.idl +++ b/CIAO/examples/Hello/Sender/Sender.idl @@ -25,9 +25,5 @@ module Hello attribute string local_message; }; - - home SenderHome manages Sender - { - }; }; #endif /*SENDER_IDL*/ diff --git a/CIAO/examples/Hello/Sender/Sender.mpc b/CIAO/examples/Hello/Sender/Sender.mpc index 0877eb7c827..35885692bbf 100644 --- a/CIAO/examples/Hello/Sender/Sender.mpc +++ b/CIAO/examples/Hello/Sender/Sender.mpc @@ -1,43 +1,67 @@ // $Id$ -// This file is generated with "generate_component_mpc.pl -p Hello_Base -u Hello -c starter Sender" +// This file is generated with "generate_component_mpc.pl -c starter -l ../lib -o ../lib -p Hello_Base Sender" -project(Hello_Sender_idl_gen) : componentidldefaults, avoids_ccm_noevent { +project(Hello_Base_Sender_idl_gen) : componentidldefaults { custom_only = 1 - after += Hello_Base_idl_gen - idlflags += \ - -Wb,stub_export_macro=SENDER_STUB_Export \ + + 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 + -Wb,exec_export_include=Sender_exec_export.h \ + -Gxhex -Gxhsk -Gxhst IDL_Files { Sender.idl } } -project(Hello_Sender_lem_gen) : ciaoidldefaults , avoids_ccm_noevent{ - after += Hello_Sender_idl_gen Hello_Base_lem_gen +project(Hello_Base_Sender_lem_gen) : ciaoidldefaults { + after += Hello_Base_Sender_idl_gen custom_only = 1 - idlflags += -Wb,export_macro=SENDER_EXEC_Export \ - -Wb,export_include=Sender_exec_export.h \ - -SS + idlflags += -Wb,stub_export_macro=SENDER_LEM_STUB_Export \ + -Wb,stub_export_include=Sender_lem_stub_export.h \ + -SS -Gxhst IDL_Files { SenderE.idl } } -project(Hello_Sender_stub) : ccm_stub , avoids_ccm_noevent{ - after += Hello_Sender_idl_gen Hello_Base_stub - libs += Hello_Base_stub - libout = ../lib +project(Hello_Base_Sender_lem_stub) : ccm_svnt { + after += Hello_Base_Sender_lem_gen Hello_Base_Sender_stub Hello_Base_stub Hello_Base_lem_stub + libs += Hello_Base_stub Hello_Base_lem_stub Sender_stub + libpaths += ../lib + libout = ../lib + sharedname = Sender_lem_stub + dynamicflags += SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } - sharedname = Hello_Sender_stub + Source_Files { + SenderEC.cpp + } + + Header_Files { + SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + SenderEC.inl + } +} + +project(Hello_Base_Sender_stub) : ccm_stub { + after += Hello_Base_Sender_idl_gen Hello_Base_stub Hello_Base_lem_stub + libs += Hello_Base_stub Hello_Base_lem_stub + + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub dynamicflags += SENDER_STUB_BUILD_DLL IDL_Files { @@ -57,45 +81,42 @@ project(Hello_Sender_stub) : ccm_stub , avoids_ccm_noevent{ } } -project(Hello_Sender_exec) : ciao_executor, avoids_ccm_noevent { - after += Hello_Sender_lem_gen Hello_Sender_stub - sharedname = Hello_Sender_exec - libs += Hello_Sender_stub Hello_Base_stub - libout = ../lib - libpaths += ../lib +project(Hello_Base_Sender_exec) : ciao_executor { + after += Hello_Base_lem_stub Hello_Base_Sender_lem_stub Hello_Base_Sender_stub + sharedname = Sender_exec + libs += Hello_Base_lem_stub Sender_stub Sender_lem_stub Hello_Base_stub Hello_Base_lem_stub + libpaths += ../lib + libout = ../lib dynamicflags += SENDER_EXEC_BUILD_DLL IDL_Files { } Source_Files { - SenderEC.cpp Sender_exec.cpp } Header_Files { - SenderEC.h Sender_exec.h Sender_exec_export.h } Inline_Files { - SenderEC.inl } } -project(Hello_Sender_svnt) : ciao_servant, avoids_ccm_noevent { - after += Hello_Base_skel Hello_Sender_exec - sharedname = Hello_Sender_svnt - libs += Hello_Sender_exec \ - Hello_Sender_stub \ +project(Hello_Base_Sender_svnt) : ciao_servant { + after += Hello_Base_skel Hello_Base_lem_stub Hello_Base_Sender_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ Hello_Base_skel \ - Hello_Base_stub - libout = ../lib - libpaths += ../lib + Hello_Base_stub \ + Hello_Base_lem_stub + libpaths += ../lib + libout = ../lib dynamicflags += SENDER_SVNT_BUILD_DLL IDL_Files { @@ -117,13 +138,13 @@ project(Hello_Sender_svnt) : ciao_servant, avoids_ccm_noevent { } } -project (Hello_starter) : ccm_stub, valuetype, avoids_ccm_noevent { +project (Hello_Base_starter) : ccm_stub, valuetype { exename = starter - after += Hello_Sender_stub - libs += Hello_Sender_stub Hello_Base_stub - libout = ../lib - libpaths += ../lib + after += Hello_Base_Sender_stub + libs += Sender_stub Hello_Base_stub Hello_Base_lem_stub + libpaths += ../lib + exeout = ../lib IDL_Files { } diff --git a/CIAO/examples/Hello/Sender/Sender_exec.cpp b/CIAO/examples/Hello/Sender/Sender_exec.cpp index 146e71c73f9..b2c1267a79a 100644 --- a/CIAO/examples/Hello/Sender/Sender_exec.cpp +++ b/CIAO/examples/Hello/Sender/Sender_exec.cpp @@ -1,7 +1,8 @@ +// -*- C++ -*- // $Id$ /** - * Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.6 + * Code generated by the The ACE ORB (TAO) IDL Compiler v2.0.2 * TAO and the TAO IDL Compiler have been developed by: * Center for Distributed Object Computing * Washington University @@ -13,7 +14,6 @@ * University of California at Irvine * Irvine, CA * USA - * http://doc.ece.uci.edu/ * and * Institute for Software Integrated Systems * Vanderbilt University @@ -25,48 +25,45 @@ * http://www.cs.wustl.edu/~schmidt/TAO.html **/ -// TAO_IDL - Generated from -// .\be\be_codegen.cpp:1278 - #include "Sender_exec.h" -#include "ace/OS_NS_time.h" namespace CIAO_Hello_Sender_Impl { - //============================================================ - // Facet Executor Implementation Class: ReadMessage_exec_i - //============================================================ - ReadMessage_exec_i::ReadMessage_exec_i (Sender_exec_i& component) - : component_ (component) + /** + * Facet Executor Implementation Class: push_message_exec_i + */ + + push_message_exec_i::push_message_exec_i ( + ::Hello::CCM_Sender_Context_ptr ctx, + Sender_exec_i& sender) + : ciao_context_ ( + ::Hello::CCM_Sender_Context::_duplicate (ctx)) + , sender_ (sender) { } - ReadMessage_exec_i::~ReadMessage_exec_i () + push_message_exec_i::~push_message_exec_i (void) { } // Operations from ::Hello::ReadMessage char * - ReadMessage_exec_i::get_message (void) + push_message_exec_i::get_message (void) { /* Your code here. */ - ACE_DEBUG ((LM_EMERGENCY, "Sender returning message: [%C]\n", component_.message_.in ())); - return CORBA::string_dup (component_.message_.in ()); + ACE_DEBUG ((LM_EMERGENCY, "Sender returning message: [%C]\n", + this->sender_.local_message())); + return CORBA::string_dup (this->sender_.local_message()); } - //============================================================ - // Component Executor Implementation Class: Sender_exec_i - //============================================================ + /** + * Component Executor Implementation Class: Sender_exec_i + */ Sender_exec_i::Sender_exec_i (void) - : message_(CORBA::string_dup ("Default Message")) - { - } - - Sender_exec_i::Sender_exec_i (const char* local_message) - : message_(CORBA::string_dup (local_message)) + : local_message_ ("Hello, world!") { } @@ -83,7 +80,7 @@ namespace CIAO_Hello_Sender_Impl Hello::TimeOut_var event = new OBV_Hello::TimeOut; event->data ("ACE/TAO/CIAO"); ACE_DEBUG ((LM_EMERGENCY, "Sender initiates the process.\n")); - this->context_->push_click_out (event.in ()); + this->ciao_context_->push_click_out (event.in ()); } // Component attributes and port operations. @@ -91,25 +88,35 @@ namespace CIAO_Hello_Sender_Impl ::Hello::CCM_ReadMessage_ptr Sender_exec_i::get_push_message (void) { - /* Your code here. */ - ACE_DEBUG ((LM_EMERGENCY, - "Sender_exec.i::get_push_message called\n")); - return ( new ReadMessage_exec_i (*this) ); + if ( ::CORBA::is_nil (this->ciao_push_message_.in ())) + { + push_message_exec_i *tmp = 0; + ACE_NEW_RETURN ( + tmp, + push_message_exec_i ( + this->ciao_context_.in (), + *this), + ::Hello::CCM_ReadMessage::_nil ()); + + this->ciao_push_message_ = tmp; + } + + return + ::Hello::CCM_ReadMessage::_duplicate ( + this->ciao_push_message_.in ()); } char * Sender_exec_i::local_message (void) { - /* Your code here. */ - return CORBA::string_dup (message_.in ()); + return ::CORBA::string_dup (this->local_message_.in ()); } void Sender_exec_i::local_message ( const char * local_message) { - /* Your code here. */ - message_ = CORBA::string_dup (local_message); + this->local_message_ = ::CORBA::string_dup (local_message); } // Operations from Components::SessionComponent. @@ -118,11 +125,10 @@ namespace CIAO_Hello_Sender_Impl Sender_exec_i::set_session_context ( ::Components::SessionContext_ptr ctx) { - ACE_DEBUG ((LM_EMERGENCY, "Sender_exec_i::set_session_context\n")); - this->context_ = + this->ciao_context_ = ::Hello::CCM_Sender_Context::_narrow (ctx); - if ( ::CORBA::is_nil (this->context_.in ())) + if ( ::CORBA::is_nil (this->ciao_context_.in ())) { throw ::CORBA::INTERNAL (); } @@ -171,55 +177,3 @@ namespace CIAO_Hello_Sender_Impl return retval; } } - -namespace CIAO_Hello_Sender_Impl -{ - //============================================================ - // Home Executor Implementation Class: SenderHome_exec_i - //============================================================ - - SenderHome_exec_i::SenderHome_exec_i (void) - { - } - - SenderHome_exec_i::~SenderHome_exec_i (void) - { - } - - // All operations and attributes. - - // Factory operations. - - // Finder operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - SenderHome_exec_i::create (void) - { - ACE_DEBUG ((LM_EMERGENCY, "(%P|%t) creating SenderHome\n")); - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - Sender_exec_i, - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" SENDER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Hello_SenderHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_NORETURN ( - retval, - SenderHome_exec_i); - - return retval; - } -} - diff --git a/CIAO/examples/Hello/Sender/Sender_exec.h b/CIAO/examples/Hello/Sender/Sender_exec.h index f8d49661c26..9cb5cd83f4a 100644 --- a/CIAO/examples/Hello/Sender/Sender_exec.h +++ b/CIAO/examples/Hello/Sender/Sender_exec.h @@ -2,7 +2,7 @@ // $Id$ /** - * Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.6 + * Code generated by the The ACE ORB (TAO) IDL Compiler v2.0.2 * TAO and the TAO IDL Compiler have been developed by: * Center for Distributed Object Computing * Washington University @@ -14,7 +14,6 @@ * University of California at Irvine * Irvine, CA * USA - * http://doc.ece.uci.edu/ * and * Institute for Software Integrated Systems * Vanderbilt University @@ -25,13 +24,10 @@ * Information about TAO is available at: * http://www.cs.wustl.edu/~schmidt/TAO.html **/ +#ifndef CIAO_SENDER_EXEC_NECH9V_H_ +#define CIAO_SENDER_EXEC_NECH9V_H_ -// TAO_IDL - Generated from -// .\be\be_codegen.cpp:1217 - -#ifndef CIAO_SENDER_EXEC_H_ -#define CIAO_SENDER_EXEC_H_ - +#include /**/ "ace/pre.h" #include "SenderEC.h" @@ -42,127 +38,105 @@ #include /**/ "Sender_exec_export.h" #include "tao/LocalObject.h" - namespace CIAO_Hello_Sender_Impl { class Sender_exec_i; + /** + * Provider Executor Implementation Class: push_message_exec_i + */ - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_component/facet_exh.cpp:58 - - class SENDER_EXEC_Export ReadMessage_exec_i + class push_message_exec_i : public virtual ::Hello::CCM_ReadMessage, public virtual ::CORBA::LocalObject { public: - ReadMessage_exec_i (Sender_exec_i& component); - - virtual ~ReadMessage_exec_i (void); - - // Operations and attributes from Hello::ReadMessage + push_message_exec_i ( + ::Hello::CCM_Sender_Context_ptr ctx, + Sender_exec_i& sender); + virtual ~push_message_exec_i (void); - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_operation/operation_ch.cpp:42 + /** @name Operations and attributes from Hello::ReadMessage */ + //@{ - virtual char * - get_message (void); + virtual + char * get_message (void); + //@} private: - Sender_exec_i& component_; + ::Hello::CCM_Sender_Context_var ciao_context_; + Sender_exec_i& sender_; + }; - class SENDER_EXEC_Export Sender_exec_i + /** + * Component Executor Implementation Class: Sender_exec_i + */ + + class Sender_exec_i : public virtual Sender_Exec, public virtual ::CORBA::LocalObject { public: Sender_exec_i (void); - Sender_exec_i (const char* local_message); virtual ~Sender_exec_i (void); + /** @name Supported operations and attributes. */ //@{ - /** Supported operations and attributes. */ - - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_operation/operation_ch.cpp:42 + virtual void start (void); - virtual void - start (void); //@} + /** @name Component attributes and port operations. */ //@{ - /** Component attributes and port operations. */ - virtual ::Hello::CCM_ReadMessage_ptr get_push_message (void); - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_operation/operation_ch.cpp:42 - - virtual char * - local_message (void); - - // TAO_IDL - Generated from - // c:\middleware\ace_wrappers\tao\tao_idl\be\be_visitor_operation/operation_ch.cpp:42 + virtual char * local_message (void); - virtual void - local_message ( - const char * local_message); + virtual void local_message (const char * local_message); + //@} + /** @name Operations from Components::SessionComponent. */ //@{ - /** Operations from Components::SessionComponent. */ - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - + 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); //@} + /** @name User defined public operations. */ + //@{ - private: - ::Hello::CCM_Sender_Context_var context_; - CORBA::String_var message_; - CORBA::Boolean log_time_; - friend class ReadMessage_exec_i; - }; - - extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr - create_Hello_Sender_Impl (void); -} + //@} -namespace CIAO_Hello_Sender_Impl -{ - class SENDER_EXEC_Export SenderHome_exec_i - : public virtual SenderHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - SenderHome_exec_i (void); + private: + ::Hello::CCM_Sender_Context_var ciao_context_; - virtual ~SenderHome_exec_i (void); + /** @name Component attributes. */ + //@{ + ::Hello::CCM_ReadMessage_var ciao_push_message_; - // All operations and attributes. + ::CORBA::String_var local_message_; + //@} - // Factory operations. + /** @name User defined members. */ + //@{ - // Finder operations. + //@} - // Implicit operations. + /** @name User defined private operations. */ + //@{ - virtual ::Components::EnterpriseComponent_ptr - create (void); + //@} }; - extern "C" SENDER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Hello_SenderHome_Impl (void); + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Hello_Sender_Impl (void); } -#endif /* ifndef */ +#include /**/ "ace/post.h" +#endif /* ifndef */ diff --git a/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp b/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp index 25d33abd33e..530921c2934 100644 --- a/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp +++ b/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp @@ -9,21 +9,20 @@ <!-- Implementations declarations --> - <!-- Home implementation --> - <implementation xmi:id="Hello_ReceiverHomeImplementation"> - <name>Hello_ReceiverHomeImplementation</name> + <implementation xmi:id="ReceiverComponentImplementation"> + <name>ReceiverComponentImplementation</name> <source/> - <artifact xmi:idref="Hello_Receiver_ExecArtifact" /> - <artifact xmi:idref="Hello_Receiver_SvntArtifact" /> + <artifact xmi:idref="Receiver_ExecArtifact" /> + <artifact xmi:idref="Receiver_SvntArtifact" /> <execParameter> <!-- entrypoint as exec parameter (see 10.6.1) --> - <name>home factory</name> + <name>component factory</name> <value> <type> <kind>tk_string</kind> </type> <value> - <string>create_Hello_ReceiverHome_Impl</string> + <string>create_Hello_Receiver_Impl</string> </value> </value> </execParameter> @@ -34,7 +33,7 @@ <kind>tk_string</kind> </type> <value> - <string>create_Hello_ReceiverHome_Servant</string> + <string>create_Hello_Receiver_Servant</string> </value> </value> </execParameter> @@ -45,7 +44,7 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Receiver_svnt</string> + <string>Receiver_svnt</string> </value> </value> </execParameter> @@ -56,44 +55,26 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Receiver_exec</string> + <string>Receiver_exec</string> </value> </value> </execParameter> </implementation> - <implementation xmi:id="Hello_ReceiverComponentImplementation"> - <name>Hello_ReceiverComponentImplementation</name> + <implementation xmi:id="SenderComponentImplementation"> + <name>SenderComponentImplementation</name> <source/> - <artifact xmi:idref="Hello_Receiver_ExecArtifact" /> - <artifact xmi:idref="Hello_Receiver_SvntArtifact" /> - <execParameter> - <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>edu.vanderbilt.dre.CCM.HomedComponent</string> - </value> - </value> - </execParameter> - </implementation> - - <implementation xmi:id="Hello_SenderHomeImplementation"> - <name>Hello_SenderHomeImplementation</name> - <source/> - <artifact xmi:idref="Hello_Sender_ExecArtifact" /> - <artifact xmi:idref="Hello_Sender_SvntArtifact" /> + <artifact xmi:idref="Sender_ExecArtifact" /> + <artifact xmi:idref="Sender_SvntArtifact" /> <execParameter> <!-- entrypoint as exec parameter (see 10.6.1) --> - <name>home factory</name> + <name>component factory</name> <value> <type> <kind>tk_string</kind> </type> <value> - <string>create_Hello_SenderHome_Impl</string> + <string>create_Hello_Sender_Impl</string> </value> </value> </execParameter> @@ -104,7 +85,7 @@ <kind>tk_string</kind> </type> <value> - <string>create_Hello_SenderHome_Servant</string> + <string>create_Hello_Sender_Servant</string> </value> </value> </execParameter> @@ -115,7 +96,7 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Sender_svnt</string> + <string>Sender_svnt</string> </value> </value> </execParameter> @@ -126,77 +107,18 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Sender_exec</string> - </value> - </value> - </execParameter> - </implementation> - - <implementation xmi:id="Hello_SenderComponentImplementation"> - <name>Hello_SenderComponentImplementation</name> - <source/> - <artifact xmi:idref="Hello_Sender_ExecArtifact" /> - <artifact xmi:idref="Hello_Sender_SvntArtifact" /> - <execParameter> - <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>edu.vanderbilt.dre.CCM.HomedComponent</string> + <string>Sender_exec</string> </value> </value> </execParameter> </implementation> - <instance xmi:id="Hello_ReceiverHomeInstance"> - <name>Hello_ReceiverHome</name> - <node>ReceiverNode</node> - <!-- hostname --> - <source/> - <implementation xmi:idref="Hello_ReceiverHomeImplementation" /> - <configProperty> - <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ReceiverHome.ior</string> - </value> - </value> - </configProperty> - <configProperty> - <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ReceiverHome</string> - </value> - </value> - </configProperty> - </instance> - - <instance xmi:id="Hello_ReceiverComponentInstance"> - <name>Hello_ReceiverComponent</name> + <instance xmi:id="ReceiverComponentInstance"> + <name>ReceiverComponent</name> <node>ReceiverNode</node> <!-- hostname --> <source/> - <implementation xmi:idref="Hello_ReceiverComponentImplementation" /> - <configProperty> - <name>edu.vanderbilt.dre.CIAO.ComponentHomeId</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Hello_ReceiverHome</string> - </value> - </value> - </configProperty> + <implementation xmi:idref="ReceiverComponentImplementation" /> <configProperty> <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> <value> @@ -232,53 +154,12 @@ </configProperty> </instance> - <instance xmi:id="Hello_SenderHomeInstance"> - <name>Hello_SenderHome</name> - <node>SenderNode</node> - <!-- hostname --> - <source/> - <implementation xmi:idref="Hello_SenderHomeImplementation" /> - <configProperty> - <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>SenderHome.ior</string> - </value> - </value> - </configProperty> - <configProperty> - <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>SenderHome</string> - </value> - </value> - </configProperty> - </instance> - - <instance xmi:id="Hello_SenderComponentInstance"> - <name>Hello_SenderComponent</name> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> <node>SenderNode</node> <!-- hostname --> <source/> - <implementation xmi:idref="Hello_SenderComponentImplementation" /> - <configProperty> - <name>edu.vanderbilt.dre.CIAO.ComponentHomeId</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Hello_SenderHome</string> - </value> - </value> - </configProperty> + <implementation xmi:idref="SenderComponentImplementation" /> <configProperty> <name>local_message</name> <value> @@ -320,13 +201,13 @@ <portName>read_message</portName> <provider>false</provider> <kind>SimplexReceptacle</kind> - <instance xmi:idref="Hello_ReceiverComponentInstance" /> + <instance xmi:idref="ReceiverComponentInstance" /> </internalEndpoint> <internalEndpoint> <portName>push_message</portName> <provider>true</provider> <kind>Facet</kind> - <instance xmi:idref="Hello_SenderComponentInstance" /> + <instance xmi:idref="SenderComponentInstance" /> </internalEndpoint> </connection> @@ -336,41 +217,41 @@ <portName>click_out</portName> <provider>false</provider> <kind>EventPublisher</kind> - <instance xmi:idref="Hello_SenderComponentInstance" /> + <instance xmi:idref="SenderComponentInstance" /> </internalEndpoint> <internalEndpoint> <portName>click_in</portName> <provider>true</provider> <kind>EventConsumer</kind> - <instance xmi:idref="Hello_ReceiverComponentInstance" /> + <instance xmi:idref="ReceiverComponentInstance" /> </internalEndpoint> </connection> <!-- Artifacts declarations --> - <artifact xmi:id="Hello_Receiver_ExecArtifact"> - <name>Hello_Receiver_exec</name> + <artifact xmi:id="Receiver_ExecArtifact"> + <name>Receiver_exec</name> <source/> <node/> - <location>Hello_Receiver_exec</location> + <location>Receiver_exec</location> </artifact> - <artifact xmi:id="Hello_Receiver_SvntArtifact"> - <name>Hello_Receiver_svnt</name> + <artifact xmi:id="Receiver_SvntArtifact"> + <name>Receiver_svnt</name> <source/> <node/> - <location>Hello_Receiver_svnt</location> + <location>Receiver_svnt</location> </artifact> - <artifact xmi:id="Hello_Sender_ExecArtifact"> - <name>Hello_Sender_exec</name> + <artifact xmi:id="Sender_ExecArtifact"> + <name>Sender_exec</name> <source/> <node/> - <location>Hello_Sender_exec</location> + <location>Sender_exec</location> </artifact> - <artifact xmi:id="Hello_Sender_SvntArtifact"> - <name>Hello_Sender_svnt</name> + <artifact xmi:id="Sender_SvntArtifact"> + <name>Sender_svnt</name> <source/> <node/> - <location>Hello_Sender_svnt</location> + <location>Sender_svnt</location> </artifact> </Deployment:DeploymentPlan> diff --git a/CIAO/examples/Hello/descriptors/DeploymentPlan_without_ns.cdp b/CIAO/examples/Hello/descriptors/DeploymentPlan_without_ns.cdp index 8505c4c3717..8396ead84d7 100644 --- a/CIAO/examples/Hello/descriptors/DeploymentPlan_without_ns.cdp +++ b/CIAO/examples/Hello/descriptors/DeploymentPlan_without_ns.cdp @@ -9,21 +9,20 @@ <!-- Implementations declarations --> - <!-- Home implementation --> - <implementation xmi:id="Hello_ReceiverHomeImplementation"> - <name>Hello_ReceiverHomeImplementation</name> + <implementation xmi:id="Hello_ReceiverComponentImplementation"> + <name>Hello_ReceiverComponentImplementation</name> <source/> <artifact xmi:idref="Hello_Receiver_ExecArtifact" /> <artifact xmi:idref="Hello_Receiver_SvntArtifact" /> <execParameter> <!-- entrypoint as exec parameter (see 10.6.1) --> - <name>home factory</name> + <name>component factory</name> <value> <type> <kind>tk_string</kind> </type> <value> - <string>create_Hello_ReceiverHome_Impl</string> + <string>create_Hello_Receiver_Impl</string> </value> </value> </execParameter> @@ -34,7 +33,7 @@ <kind>tk_string</kind> </type> <value> - <string>create_Hello_ReceiverHome_Servant</string> + <string>create_Hello_Receiver_Servant</string> </value> </value> </execParameter> @@ -45,7 +44,7 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Receiver_svnt</string> + <string>Receiver_svnt</string> </value> </value> </execParameter> @@ -56,44 +55,26 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Receiver_exec</string> + <string>Receiver_exec</string> </value> </value> </execParameter> </implementation> - <implementation xmi:id="Hello_ReceiverComponentImplementation"> - <name>Hello_ReceiverComponentImplementation</name> - <source/> - <artifact xmi:idref="Hello_Receiver_ExecArtifact" /> - <artifact xmi:idref="Hello_Receiver_SvntArtifact" /> - <execParameter> - <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>edu.vanderbilt.dre.CCM.HomedComponent</string> - </value> - </value> - </execParameter> - </implementation> - - <implementation xmi:id="Hello_SenderHomeImplementation"> - <name>Hello_SenderHomeImplementation</name> + <implementation xmi:id="Hello_SenderComponentImplementation"> + <name>Hello_SenderComponentImplementation</name> <source/> <artifact xmi:idref="Hello_Sender_ExecArtifact" /> <artifact xmi:idref="Hello_Sender_SvntArtifact" /> <execParameter> <!-- entrypoint as exec parameter (see 10.6.1) --> - <name>home factory</name> + <name>component factory</name> <value> <type> <kind>tk_string</kind> </type> <value> - <string>create_Hello_SenderHome_Impl</string> + <string>create_Hello_Sender_Impl</string> </value> </value> </execParameter> @@ -104,7 +85,7 @@ <kind>tk_string</kind> </type> <value> - <string>create_Hello_SenderHome_Servant</string> + <string>create_Hello_Sender_Servant</string> </value> </value> </execParameter> @@ -115,7 +96,7 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Sender_svnt</string> + <string>Sender_svnt</string> </value> </value> </execParameter> @@ -126,49 +107,12 @@ <kind>tk_string</kind> </type> <value> - <string>Hello_Sender_exec</string> - </value> - </value> - </execParameter> - </implementation> - - <implementation xmi:id="Hello_SenderComponentImplementation"> - <name>Hello_SenderComponentImplementation</name> - <source/> - <artifact xmi:idref="Hello_Sender_ExecArtifact" /> - <artifact xmi:idref="Hello_Sender_SvntArtifact" /> - <execParameter> - <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>edu.vanderbilt.dre.CCM.HomedComponent</string> + <string>Sender_exec</string> </value> </value> </execParameter> </implementation> - <instance xmi:id="Hello_ReceiverHomeInstance"> - <name>Hello_ReceiverHome</name> - <node>ReceiverNode</node> - <!-- hostname --> - <source/> - <implementation xmi:idref="Hello_ReceiverHomeImplementation" /> - <configProperty> - <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ReceiverHome.ior</string> - </value> - </value> - </configProperty> - </instance> - <instance xmi:id="Hello_ReceiverComponentInstance"> <name>Hello_ReceiverComponent</name> <node>ReceiverNode</node> @@ -176,17 +120,6 @@ <source/> <implementation xmi:idref="Hello_ReceiverComponentImplementation" /> <configProperty> - <name>edu.vanderbilt.dre.CIAO.ComponentHomeId</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Hello_ReceiverHome</string> - </value> - </value> - </configProperty> - <configProperty> <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> <value> <type> @@ -199,25 +132,6 @@ </configProperty> </instance> - <instance xmi:id="Hello_SenderHomeInstance"> - <name>Hello_SenderHome</name> - <node>SenderNode</node> - <!-- hostname --> - <source/> - <implementation xmi:idref="Hello_SenderHomeImplementation" /> - <configProperty> - <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>SenderHome.ior</string> - </value> - </value> - </configProperty> - </instance> - <instance xmi:id="Hello_SenderComponentInstance"> <name>Hello_SenderComponent</name> <node>SenderNode</node> @@ -225,17 +139,6 @@ <source/> <implementation xmi:idref="Hello_SenderComponentImplementation" /> <configProperty> - <name>edu.vanderbilt.dre.CIAO.ComponentHomeId</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Hello_SenderHome</string> - </value> - </value> - </configProperty> - <configProperty> <name>local_message</name> <value> <type> @@ -293,29 +196,29 @@ <!-- Artifacts declarations --> <artifact xmi:id="Hello_Receiver_ExecArtifact"> - <name>Hello_Receiver_exec</name> + <name>Receiver_exec</name> <source/> <node/> - <location>Hello_Receiver_exec</location> + <location>Receiver_exec</location> </artifact> <artifact xmi:id="Hello_Receiver_SvntArtifact"> - <name>Hello_Receiver_svnt</name> + <name>Receiver_svnt</name> <source/> <node/> - <location>Hello_Receiver_svnt</location> + <location>Receiver_svnt</location> </artifact> <artifact xmi:id="Hello_Sender_ExecArtifact"> - <name>Hello_Sender_exec</name> + <name>Sender_exec</name> <source/> <node/> - <location>Hello_Sender_exec</location> + <location>Sender_exec</location> </artifact> <artifact xmi:id="Hello_Sender_SvntArtifact"> - <name>Hello_Sender_svnt</name> + <name>Sender_svnt</name> <source/> <node/> - <location>Hello_Sender_svnt</location> + <location>Sender_svnt</location> </artifact> </Deployment:DeploymentPlan> diff --git a/CIAO/examples/Hello/step-by-step.html b/CIAO/examples/Hello/step-by-step.html index 7e0f3688b50..ea3c80886d4 100644 --- a/CIAO/examples/Hello/step-by-step.html +++ b/CIAO/examples/Hello/step-by-step.html @@ -15,91 +15,163 @@ <hr> <h2>Simple <a href="http://www.dre.vanderbilt.edu/CIAO">CIAO</a> tutorial</h2> <b>Note:</b> -<UL> -<li><a href="http://www.dre.vanderbilt.edu/cosmic">CoSMIC</a> tools are not used in this tutorial.</li> -<li>This is only a <em>GENERAL</em> way of building up a CIAO application and deploying it with DAnCE. The user could always change the process in his own way. For example: the IDL file content, the project structure etc.</li> -<li>To download the code of this example please refer to the SVN repository at <code>$CIAO_ROOT/examples/Hello</code>.</li> -</UL> +<ul> + <li><a href="http://www.dre.vanderbilt.edu/cosmic">CoSMIC</a> tools are not used in this tutorial.</li> + <li>This is only a <em>GENERAL</em> way of building up a CIAO application and deploying it with DAnCE. + The user could always change the process in his own way. For example: the IDL file content, the project structure etc. + </li> + <li>To download the code of this example please refer to the SVN repository at <code>$CIAO_ROOT/examples/Hello</code>.</li> +</ul> <hr> <h2>Example Description</h2> This Hello example is contructed in the following ways: -<UL> -<li>1. There are 2 components in the system: Sender and Receiver</li> -<li>2. The Sender will send out the timeout event to the Receiver.</li> -<li>3. Upon receiving the timeout event, the Receiver will go and fetch data from the Sender. </li> -<li>4. The user could deploy multiple instances of the Receiver without changing any C++/idl source code.</li> -</UL> +<ol> + <li>There are 2 components in the system: Sender and Receiver</li> + <li>The Sender will send out the timeout event to the Receiver.</li> + <li>Upon receiving the timeout event, the Receiver will go and fetch data from the Sender. </li> + <li>The user could deploy multiple instances of the Receiver without changing any C++/idl source code.</li> +</ol> + +<hr> + +<h2>Code generation</h2> +Note that an user only need to write the IDL files. All the rest of the files can be generated. +The following code generators are use throughout this example: +<ul> + <li><code>$CIAO_ROOT/bin/generate_component_mpc.pl</code><br/> + This perl script is able to generate MPC files out of a single name. + <a href="http://downloads.ociweb.com/MPC/MakeProjectCreator.pdf">MPC</a> is a utility we use + to generate makefiles or VC project/solution files for all + <a href="http://www.cs.wustl.edu/~schmidt/ACE.html">ACE</a>, + <a href="http://www.cs.wustl.edu/~schmidt/TAO.html">TAO</a> and + <a href="http://www.cs.wustl.edu/~schmidt/CIAO.html">CIAO</a> + libraries and executables.<br/> + </li> + <li><code>$ACE_ROOT/bin/tao_idl</code> + Besides all the stub and skeleton code, the TAO IDL compiler is also suitable to generate the + so called executor files. An executor C++ code file contains the business logic + the user need to write. Since this should be deployable by the DAnCE framework, there're + some restriction to this code. The TAO IDL compiler takes care of that. + </li> + <li><code>$ACE_ROOT/bin/mwc.pl</code> + This script will generate VS solutions and/or GNU makefiles out of the generated + MPC files. + </li> +</ul> +All these generators will be handled throughout this tutorial. <hr> <h2>Step-By-Step</h2> <h3>Hello_Base</h3> -<OL> -<li>Write an IDL file (<a href="./Hello_Base/Hello_Base.idl"><code>Hello_Base.idl</code></a>) which contains all - the interfaces and events common to all the components. The reason - we do this is because the generated lib of this idl file will be - linked in by all the components in the system. To reduce the size - of the component lib we have to include only the necesary part. In - this example, we have an eventtype <code>timeout</code> and an - interface <code>ReadMessage</code>, which are used by both the - Sender and the Receiver, so we put both of them in <a href="Hello_Base/Hello_Base.idl">Hello_Base.idl</a>.</li> - <P> - -<li>Look at the <a href="Hello_Base/Hello_Base.mpc"><code>Hello_Base.mpc</code></a> file to get an idea how the Hello_Base_stub - and Hello_Base_svnt projects are organized. - <a href="http://downloads.ociweb.com/MPC/MakeProjectCreator.pdf">MPC</a> is a utility we used to generate makefiles or VC - project/solution files for all <a href="http://www.cs.wustl.edu/~schmidt/ACE.html">ACE</a>, - <a href="http://www.cs.wustl.edu/~schmidt/TAO.html">TAO</a> and <a href="http://www.cs.wustl.edu/~schmidt/CIAO.html">CIAO</a> - libraries.</li> -</Ol> +<ol> + <li>Write an IDL file (<a href="./Hello_Base/Hello_Base.idl"><code>Hello_Base.idl</code></a>) which contains all + the interfaces and events common to all the components. The reason + we do this is because the generated lib of this idl file will be + linked in by all the components in the system. To reduce the size + of the component lib we have to include only the necesary part. In + this example, we have an eventtype <code>timeout</code> and an + interface <code>ReadMessage</code>, which are used by both the + Sender and the Receiver, so we put both of them in <a href="Hello_Base/Hello_Base.idl">Hello_Base.idl</a>. + </li> + <br/> + <li>Look at the <a href="Hello_Base/Hello_Base.mpc"><code>Hello_Base.mpc</code></a> file to get an idea how the Hello_Base_stub + and Hello_Base_svnt projects are organized.<br/> + There's a utility in $CIAO_ROOT/bin, called generate_component_mpc. This a perl script which is able to generate a complete + mpc file based on a given name. The commandline used to generate <code>Hello_Base.mpc</code> is:<br/> + <code>$CIAO_ROOT/bin/generate_component_mpc.pl -n -l../lib -o../lib Hello_Base</code><br/> + Use <code>$CIAO_ROOT/bin/generate_component_mpc.pl --help</code> to get more information about this tool. + See also the <a href="../../tutorials/Quoter/Simple/01.html">Quoter tutorial</a> for more information. + </li> +</ol> <hr> <h3>For Every Components</h3> <ol> -<li>Execute : <br> -<ul> -<code>$CIAO_ROOT/bin/generate_component_mpc.pl -p Hello_Base Sender</code> in Sender directory<br> -<code>$CIAO_ROOT/bin/generate_component_mpc.pl -p Hello_Base Receiver</code> in Receiver directory<br> -</ul> -Note: -<ul> -<li>I have different directories for <code>"Hello_Base", "Sender", "Receiver"</code> respectively.</li> - -<li>For every <code>_stub</code> project, add:<br> - <code>"libs += Hello_Base_DnC_stub"</code><br> - -</ul> -The output of this scripts includes an MPC file and 3 export header files -(..._svnt_export.h, ..._exec_export.h and ..._stub_export.h). -<P> - -<li>Write an idl file for every component (<a href="Sender/Sender.idl"><code>Sender.idl</code></a> and - <a href="Receiver/Receiver.idl"><code>Receiver.idl</code></a>). <br> Here you can put the - component specific IDL definitions in this file. In this example we have a interface <code>trigger</code> - specific to the Sender. Please note that the Sender component - <code>"supports"</code> (IDL keyword) this interface. </li> <P> - -<li>Write the CIDL file for every component (<a href="Sender/Sender.cidl"><code>Sender.cidl</code></a> and - <a href="Receiver/Receiver.cidl"><code>Receiver.cidl</code></a>). -</li><P> - -<li>Compile these cidl files, using <code>$CIAO_ROOT/bin/cidlc.exe Receiver.cidl --gen-exec-impl -I$CIAO_ROOT/ccm -I$CIAO_ROOT -I$TAO_ROOT</code>. - This'll result in ..._exec.cpp/..._exec.h and ..._svnt.cpp/..._svnt.h files. -</li><P> - -<li>Write <code>_exec.h</code> and <code>_exec.cpp</code> files which actually implement the component.</li> -<P> -</OL> + <li>Execute : <br> + <ul> + <li><code>$CIAO_ROOT/bin/generate_component_mpc.pl -l ../lib -o ../lib -c starter -p Hello_Base Sender</code> in Sender directory. + The <code>-c</code> option will be handled later on in the step-by-step. + </li> + <li><code>$CIAO_ROOT/bin/generate_component_mpc.pl -l ../lib -o ../lib -p Hello_Base Receiver</code> in Receiver directory + </li> + </ul> + <b>Note:</b> + <ul> + <li>There're different directories for <code>"Hello_Base", "Sender", "Receiver"</code> respectively. + </li> + <li>All output DLL's/executable will be stored in a separate directory, called "lib". + </li> + </ul> + + <br/> + + <li>Write an IDL file for every component (<a href="Sender/Sender.idl"><code>Sender.idl</code></a> and + <a href="Receiver/Receiver.idl"><code>Receiver.idl</code></a>). <br> Here you can put the + component specific IDL definitions in this file. In this example we have a interface <code>trigger</code> + specific to the Sender. Please note that the Sender component + <code>"supports"</code> (IDL keyword) this interface. This interface can be used by + <a href="Sender/starter.cpp"><code>starter</code></a> (an IDL 2 client) to start the application. + </li> + + <br/> + + <li>There's a possibility that the TAO IDL compiler can generate a 'template' for the executor code. + Steps to generate executor files: + <ol> + <li>Backup the following files to a temporary directory:<br/> + <ul> + <li>Sender/Sender_exec.cpp + </li> + <li>Sender/Sender_exec.h + </li> + <li>Receiver/Receiver_exec.cpp + </li> + <li>Receiver/Receiver_exec.h + </li> + </ul> + </li> + <li>Add -Gex or -Gexr to the <code>idlflags</code> entry in the + IDL generator projects in the MPC file + </li> + <ul> + <li>Project <code>Hello_Base_Sender_idl_gen</code> in Sender/Sender.mpc + </li> + <li>Project <code>Hello_Base_Receiver_idl_gen</code> in Receiver/Receiver.mpc + </li> + </ul> + <li>Generate GNUmakefiles / VS project files and build + </li> + <li>Remove -Gex(r) again + </li> + <li>Generate GNUmakefiles / VS project files (and build) + </li> + </ol> + <b>Mind the last step! The TAO IDL compiler does not check whether the + executor file already exists. It will overwrite the existing!</b><br/><br/> + After step 2 the following files should be overwritten: + <ul> + <li>Sender/Sender_exec.cpp + </li> + <li>Sender/Sender_exec.h + </li> + <li>Receiver/Receiver_exec.cpp + </li> + <li>Receiver/Receiver_exec.h + </li> + </ul> + </li> +</ol> -Writing all those files could be troublesome to a new CCM user. The -best way of learning this is to read the example source code. If you -are familliar with CORBA programming, it should not take too much time -before you can declare yourself as a CCM programmer. <P> +Performing all steps could be troublesome to a new CCM user. The +best way of learning this is to just do more than once. I'll also help to +read the example source code. If you are familliar with CORBA programming, +it should not take too much time before you can declare yourself as a CCM programmer.<br/> -<hr> <P> +<hr> <h3>The Entry Point</h3> @@ -112,24 +184,38 @@ called <code>trigger</code> on the Sender component to get the whole distributed application started. The <code>starter</code> will first obtain the Sender component object reference through the ior string supplied as a command argument. Please see the the last part of -<code>Hello/Sender/Sender.mpc</code> file for details. <P> +<code>Sender/Sender.mpc</code> file for details. <br/> <hr> -<h3>Make</h3> +<h3>Build</h3> -<UL> -<li>Go to the directory <code>$DANCE_ROOT</code> and do:<br> - <code>$ACE_ROOT/bin/mwc.pl</code></li> - <br>For example, using <code>$ACE_ROOT/bin/mwc.pl -type vc71</code> if you are using Visual C++ 7.1 IDE - <br>or <code>$ACE_ROOT/bin/mwc.pl -type gnuace</code> on Linux platforms.</li><P> -<li>Look at the generated Makefile(*unx) or Solution/workspace files(Windows) and you got it.</li> -</UL> -After building DAnCE, a solution or makefile should be generated for this CIAO example. -Navigate to <code>$CIAO_ROOT/examples/Hello</code> and execute <code>$ACE_ROOT/bin/mwc.pl -type vc71</code> for -Visual C++ 7.1 or <code>$ACE_ROOT/bin/mwc.pl -type gnuace</code> on Linux platforms. -Build this example using Visual Studio or make. -<P><hr> +This example assumes that ACE/TAO/CIAO/DANCE is build. If not, please +follow the instructions to build these frameworks.<br/> +<b>Tip : </b>Experienced users may want to use <code>$CIAO_ROOT/CIAO_TAO_DAnCE.mwc</code> +to generate the needed VC project/solutions of GNU make files.<br/> + +Perform the following steps to build this example: <br/> +<ol> + <li>Navigate to <code>$CIAO_ROOT/examples/Hello</code> + </li> + <li>For windows:<br/> + <ul> + <li>Visual C++ 2005: execute <code>$ACE_ROOT/bin/mwc.pl -type vc8</code> + </li> + <li>Visual C++ 2008: execute <code>$ACE_ROOT/bin/mwc.pl -type vc9</code> + </li> + <li>Visual C++ 2010: execute <code>$ACE_ROOT/bin/mwc.pl -type vc10</code> + </li> + </ul> + </li> + <li>For linux:<br/> + Execute <code>$ACE_ROOT/bin/mwc.pl -type gnuace</code>. + </li> +</ol> +Build this example using Visual Studio or make.<br/> + +<hr> <h3>Assemble</h3> @@ -165,6 +251,7 @@ The former file can be found in $CIAO_ROOT/docs/schema directory. <P> </UL> <hr> + <h3>Deploy with <A href="../../docs/releasenotes/dance.html">DAnCE</A></h3> Finally you are ready to deploy the component-based application you have developed. <br><br> |