summaryrefslogtreecommitdiff
path: root/CIAO/examples/Hello/Sender/Sender_exec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CIAO/examples/Hello/Sender/Sender_exec.cpp')
-rw-r--r--CIAO/examples/Hello/Sender/Sender_exec.cpp130
1 files changed, 42 insertions, 88 deletions
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;
- }
-}
-