diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/examples/AMI | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/examples/AMI')
-rw-r--r-- | TAO/examples/AMI/FL_Callback/.cvsignore | 2 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/FL_Callback.mpc | 35 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/Makefile.am | 148 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/Peer_i.cpp | 165 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/Peer_i.h | 131 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/Progress_i.cpp | 170 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/Progress_i.h | 92 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/README | 20 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/peer.conf | 3 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/peer.conf.xml | 7 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/peer.cpp | 183 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/progress.cpp | 144 | ||||
-rw-r--r-- | TAO/examples/AMI/FL_Callback/test.idl | 41 | ||||
-rw-r--r-- | TAO/examples/AMI/Makefile.am | 13 |
14 files changed, 0 insertions, 1154 deletions
diff --git a/TAO/examples/AMI/FL_Callback/.cvsignore b/TAO/examples/AMI/FL_Callback/.cvsignore deleted file mode 100644 index 3a6a218885f..00000000000 --- a/TAO/examples/AMI/FL_Callback/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -peer -progress diff --git a/TAO/examples/AMI/FL_Callback/FL_Callback.mpc b/TAO/examples/AMI/FL_Callback/FL_Callback.mpc deleted file mode 100644 index 9e2fa3a3042..00000000000 --- a/TAO/examples/AMI/FL_Callback/FL_Callback.mpc +++ /dev/null @@ -1,35 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*idl): taoexe, messaging, ami { - IDL_Files { - test.idl - } - custom_only = 1 -} - -project(*progress): taoexe, messaging, ami, portableserver, tao_flresource { - after += *idl - - Source_Files { - Progress_i.cpp - progress.cpp - testS.cpp - testC.cpp - } - IDL_Files { - } -} - -project(*peer): taoexe, strategies, messaging, ami, portableserver { - after += *idl - - Source_Files { - Peer_i.cpp - peer.cpp - testS.cpp - testC.cpp - } - IDL_Files { - } -} diff --git a/TAO/examples/AMI/FL_Callback/Makefile.am b/TAO/examples/AMI/FL_Callback/Makefile.am deleted file mode 100644 index 6639157e369..00000000000 --- a/TAO/examples/AMI/FL_Callback/Makefile.am +++ /dev/null @@ -1,148 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -noinst_PROGRAMS = - -## Makefile.FL_Callback_Idl.am - -if BUILD_AMI -if BUILD_CORBA_MESSAGING - -BUILT_SOURCES = \ - testC.cpp \ - testC.h \ - testC.inl \ - testS.cpp \ - testS.h \ - testS.inl - -CLEANFILES = \ - test-stamp \ - testC.cpp \ - testC.h \ - testC.inl \ - testS.cpp \ - testS.h \ - testS.inl - -testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp - -test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -GC $(srcdir)/test.idl - @touch $@ - - -noinst_HEADERS = \ - test.idl - -endif BUILD_CORBA_MESSAGING -endif BUILD_AMI - -## Makefile.FL_Callback_Peer.am - -if BUILD_AMI -if BUILD_CORBA_MESSAGING -if !BUILD_ACE_FOR_TAO - -noinst_PROGRAMS += peer - -peer_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) - -peer_SOURCES = \ - Peer_i.cpp \ - peer.cpp \ - testC.cpp \ - testS.cpp \ - Peer_i.h - -peer_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \ - $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -endif !BUILD_ACE_FOR_TAO -endif BUILD_CORBA_MESSAGING -endif BUILD_AMI - -## Makefile.FL_Callback_Progress.am - -if BUILD_ACE_FLREACTOR -if BUILD_AMI -if BUILD_CORBA_MESSAGING -if BUILD_FL -if BUILD_GL -if BUILD_TAO_FLRESOURCE -if BUILD_X11 - -noinst_PROGRAMS += progress - -progress_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - $(ACE_FLTK_CPPFLAGS) - -progress_SOURCES = \ - Progress_i.cpp \ - progress.cpp \ - testC.cpp \ - testS.cpp \ - Progress_i.h - -progress_LDFLAGS = \ - $(ACE_FLTK_LDFLAGS) - -progress_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_FlResource.la \ - $(ACE_BUILDDIR)/ace/libACE_FlReactor.la \ - $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la \ - $(ACE_FLTK_LIBS) - -endif BUILD_X11 -endif BUILD_TAO_FLRESOURCE -endif BUILD_GL -endif BUILD_FL -endif BUILD_CORBA_MESSAGING -endif BUILD_AMI -endif BUILD_ACE_FLREACTOR - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/AMI/FL_Callback/Peer_i.cpp b/TAO/examples/AMI/FL_Callback/Peer_i.cpp deleted file mode 100644 index f4e81a5b099..00000000000 --- a/TAO/examples/AMI/FL_Callback/Peer_i.cpp +++ /dev/null @@ -1,165 +0,0 @@ -// $Id$ - -#include "Peer_i.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID(FL_Callback, Peer_i, "$Id$") - -Peer_Handler_i::Peer_Handler_i (Peer_i *peer) - : peer_ (peer) -{ -} - -void -Peer_Handler_i::request (CORBA::Long retval - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - static int i = 0; - i++; - if (i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) %d replies received\n", i)); - this->peer_->reply (retval ACE_ENV_ARG_PARAMETER); -} - - -void -Peer_Handler_i::request_excep ( - ::Messaging::ExceptionHolder * - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Peer_Handler_i::start (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Peer_Handler_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - -{ -} - -Peer_i::Peer_i (void) - : reply_handler_ (this) -{ -} - -Peer_i::~Peer_i (void) -{ -} - -void -Peer_i::init (CORBA::ORB_ptr orb, - Progress_ptr progress, - const ACE_Time_Value &delay - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_ = CORBA::ORB::_duplicate (orb); - this->progress_ = Progress::_duplicate (progress); - this->delay_ = delay; - - Peer_var peer = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Peer (%P|%t) - binding\n")); - this->id_ = this->progress_->bind (peer.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -Peer_i::reply (CORBA::Long result - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->progress_->recv_reply (result ACE_ENV_ARG_PARAMETER); -} - -CORBA::Long -Peer_i::request (CORBA::Long id - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_Time_Value tv = this->delay_; - ACE_OS::sleep (tv); - - return id; -} - -void -Peer_i::start (const PeerSet &the_peers, - CORBA::Long iterations - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - AMI_PeerHandler_var handler = - this->reply_handler_._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // @@ Report errors as exceptions... - Peer_Task *task; - ACE_NEW (task, Peer_Task (the_peers, - iterations, - this->progress_.in (), - handler.in (), - this->id_)); - task->activate (); -} - -void -Peer_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} - -// **************************************************************** - -Peer_Task::Peer_Task (const PeerSet& the_peers, - CORBA::Long iterations, - Progress_ptr progress, - AMI_PeerHandler_ptr handler, - CORBA::Long id) - : the_peers_ (the_peers), - iterations_ (iterations), - progress_ (Progress::_duplicate (progress)), - handler_ (AMI_PeerHandler::_duplicate (handler)), - id_ (id) -{ -} - -int -Peer_Task::svc (void) -{ - for (int i = 0; i != this->iterations_; ++i) - { - CORBA::ULong l = this->the_peers_.length (); - for (CORBA::ULong j = 0; j != l; ++j) - { - ACE_TRY_NEW_ENV - { - this->the_peers_[j]->sendc_request (this->handler_.in (), - this->id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->progress_->sent_request (this->id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // Ignore exceptions; - } - ACE_ENDTRY; - } - if (i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) %d requests sent\n", i)); - } - return 0; -} diff --git a/TAO/examples/AMI/FL_Callback/Peer_i.h b/TAO/examples/AMI/FL_Callback/Peer_i.h deleted file mode 100644 index 251ca6e57c6..00000000000 --- a/TAO/examples/AMI/FL_Callback/Peer_i.h +++ /dev/null @@ -1,131 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/AMI/FL_Callback -// -// = FILENAME -// Peer_i.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef PEER_I_H -#define PEER_I_H - -#include "testS.h" -#include "ace/Task.h" - -class Peer_i; - -class Peer_Handler_i : public POA_AMI_PeerHandler -{ -public: - Peer_Handler_i (Peer_i *peer); - // The peer - - virtual void request (CORBA::Long retval - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void request_excep (::Messaging::ExceptionHolder * excep_holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void start (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - Peer_i *peer_; - // The real implementation -}; - -class Peer_i : public POA_Peer -{ -public: - Peer_i (void); - // Constructor - - virtual ~Peer_i (void); - // Destructor - - void init (CORBA::ORB_ptr orb, - Progress_ptr progress, - const ACE_Time_Value &delay - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void reply (CORBA::Long result - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Used by the Reply_Handler to indicate that a reply has been - // received. - - // = See test.idl for an explanation of these methods. - CORBA::Long request (CORBA::Long id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void start (const PeerSet& the_peers, - CORBA::Long iterations - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - Peer_Handler_i reply_handler_; - // The reply_handler - - CORBA::ORB_var orb_; - // The orb - - Progress_var progress_; - // The interface to report back progress. - - ACE_Time_Value delay_; - // The delay on each request - - CORBA::Long id_; - // The id assigned by the progress interface -}; - -class Peer_Task : public ACE_Task_Base -{ - // = DESCRIPTION - // Run a "start" request on a separate thread. -public: - Peer_Task (const PeerSet& the_peers, - CORBA::Long iterations, - Progress_ptr progress, - AMI_PeerHandler_ptr handler, - CORBA::Long id); - - virtual int svc (void); - // The thread entry point - -private: - PeerSet the_peers_; - // The peers - - CORBA::Long iterations_; - // The number of iterations - - Progress_var progress_; - // To report progress - - AMI_PeerHandler_var handler_; - // To issue async requests - - CORBA::Long id_; - // Our id -}; - -#endif /* PEER_I_H */ diff --git a/TAO/examples/AMI/FL_Callback/Progress_i.cpp b/TAO/examples/AMI/FL_Callback/Progress_i.cpp deleted file mode 100644 index 91e6c571118..00000000000 --- a/TAO/examples/AMI/FL_Callback/Progress_i.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// $Id$ - -#include "Progress_i.h" - -#include <FL/Fl_Slider.h> -#include <FL/Fl_Button.h> - -ACE_RCSID (FL_Cube, - test_i, - "$Id$") - -Progress_i::Progress_i (Progress_Window *window) - : window_ (window) -{ -} - -void -Progress_i::sent_request (CORBA::Long id - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - //ACE_DEBUG ((LM_DEBUG, "Progress (%t) - sent request %d\n", id)); - this->window_->sent_request (id); -} - -void -Progress_i::recv_reply (CORBA::Long id - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->window_->recv_reply (id); -} - -CORBA::Long -Progress_i::bind (Peer_ptr a_peer - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Progress (%t) - peer bound\n")); - return this->window_->bind (a_peer ACE_ENV_ARG_PARAMETER); -} - -// **************************************************************** - -Progress_Window::Progress_Window (int n_peers, - int n_iterations, - int x, int y, - int w, int h, - const char* l) - : Fl_Box (x, y, w, h, l), - n_peers_ (n_peers), - peers_ (n_peers), - n_iterations_ (n_iterations) -{ - ACE_NEW (this->request_progress_, Fl_Widget*[this->n_peers_]); - ACE_NEW (this->reply_progress_, Fl_Widget*[this->n_peers_]); - - // @@ leak... - Fl_Widget *button = new Fl_Button (x + 5, y + 5, - 50, h - 10, - "Start"); - button->callback (Progress_Window::start_callback, this); - - // Compute the slider height, leaving a little margin... - int sh = h / ( 2 * this->n_peers_); - sh = sh - 5; - - // The initial position, with margin... - int sy = y + 5; - - // Set the width of the sliders... - int sx = x + 60; - int sw = w - 65; - int max = this->n_peers_ * this->n_iterations_; - for (int i = 0; i < this->n_peers_; ++i) - { - Fl_Slider *obj; - - this->request_progress_[i] = obj = - new Fl_Slider (FL_HOR_FILL_SLIDER, sx, sy, sw, sh, ""); - obj->color (FL_BLACK); - obj->selection_color (FL_RED); - obj->bounds (0, max); - obj->precision (0); - obj->value (0); - sy += sh + 5; - - this->reply_progress_[i] = obj = - new Fl_Slider (FL_HOR_FILL_SLIDER, sx, sy, sw, sh, ""); - obj->color (FL_BLACK); - obj->selection_color (FL_GREEN); - obj->bounds (0, max); - obj->precision (0); - obj->value (0); - sy += sh + 5; - } -} - -void -Progress_Window::sent_request (CORBA::Long id) -{ - if (id < 0 || id >= this->n_peers_) - return; - Fl_Slider *obj = - dynamic_cast<Fl_Slider*> (this->request_progress_[id]); - obj->value (obj->value () + 1); - obj->redraw (); - - int i = static_cast<int> (obj->value ()); - if (i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "Progress (%t) - recv reply %d\n", i)); -} - -void -Progress_Window::recv_reply (CORBA::Long id) -{ - if (id < 0 || id >= this->n_peers_) - return; - Fl_Slider *obj = - dynamic_cast<Fl_Slider*> (this->reply_progress_[id]); - obj->value (obj->value () + 1); - obj->redraw (); - - int i = static_cast<int> (obj->value ()); - if (i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "Progress (%t) - recv reply %d\n", i)); -} - -CORBA::Long -Progress_Window::bind (Peer_ptr a_peer - ACE_ENV_ARG_DECL_NOT_USED) -{ - CORBA::ULong l = this->peers_.length (); - this->peers_.length (l + 1); - this->peers_[l] = Peer::_duplicate (a_peer); - - return l; -} - -void -Progress_Window::start_callback (Fl_Widget* /* widget */, - void *data) -{ - Progress_Window *self = static_cast<Progress_Window*> (data); - self->start (); -} - -void -Progress_Window::start () -{ - if (this->peers_.length () < CORBA::ULong (this->n_peers_)) - return; - - ACE_DECLARE_NEW_CORBA_ENV; - for (CORBA::ULong i = 0; i != this->peers_.length (); ++i) - { - ACE_TRY - { - this->peers_[i]->start (this->peers_, - this->n_iterations_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // Ignore exceptions - } - ACE_ENDTRY; - } -} diff --git a/TAO/examples/AMI/FL_Callback/Progress_i.h b/TAO/examples/AMI/FL_Callback/Progress_i.h deleted file mode 100644 index efb915e3b52..00000000000 --- a/TAO/examples/AMI/FL_Callback/Progress_i.h +++ /dev/null @@ -1,92 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/AMI/FL_Callback -// -// = FILENAME -// Progress_i.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef PROGRESS_I_H -#define PROGRESS_I_H - -#include "testS.h" - -#include <FL/Fl_Box.h> - -class Progress_Window : public Fl_Box -{ -public: - Progress_Window (int n_peers, - int n_iterations, - int x, int y, - int w, int h, - const char* l = 0); - // Constructor - - void sent_request (CORBA::Long id); - void recv_reply (CORBA::Long id); - // Keep track of the progress on each peer - - CORBA::Long bind (Peer_ptr a_peer - ACE_ENV_ARG_DECL); - // One of the peers has bound to the server - - void start (void); - // Start the peers... - -private: - static void start_callback (Fl_Widget* widget, void *data); - // The callback method - -private: - int n_peers_; - // The total number of peers - - PeerSet peers_; - // The peers - - int n_iterations_; - // The number of iterations; - - Fl_Widget** request_progress_; - Fl_Widget** reply_progress_; - // The set of sliders where we keep track of each client -}; - -class Progress_i : public POA_Progress -{ - // = TITLE - // Progress server implementation - // - // = DESCRIPTION - // Implements the Progress interface in test.idl, forward the - // calls to the Progress_Window class - // -public: - Progress_i (Progress_Window* window); - // ctor - - // = The Progress methods. - void sent_request (CORBA::Long id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - void recv_reply (CORBA::Long id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - CORBA::Long bind (Peer_ptr a_peer - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - Progress_Window* window_; - // Display the graphics... -}; - -#endif /* PROGRESS_I_H */ diff --git a/TAO/examples/AMI/FL_Callback/README b/TAO/examples/AMI/FL_Callback/README deleted file mode 100644 index 59c3cd0ba9a..00000000000 --- a/TAO/examples/AMI/FL_Callback/README +++ /dev/null @@ -1,20 +0,0 @@ -# $Id$ - - A demo of the AMI callback model, using the FL toolkit for the -GUI components. - - Run as: - -$ ./progress -p 4 -i 10000 -$ ./peer -n 1 -t 10000 -ORBSvcConf peer.conf -$ ./peer -n 2 -t 10000 -ORBSvcConf peer.conf -$ ./peer -n 4 -t 10000 -ORBSvcConf peer.conf -$ ./peer -n 8 -t 10000 -ORBSvcConf peer.conf - - then press "start" in the progress window. - -Notes: -- Compile TAO with TAO_HAS_CORBA_MESSAGING and TAO_HAS_AMI_CALLBACK - defined. - -- Use the switch -GC on the TAO IDL compiler to generate AMI stubs. diff --git a/TAO/examples/AMI/FL_Callback/peer.conf b/TAO/examples/AMI/FL_Callback/peer.conf deleted file mode 100644 index 3f782fbc6f0..00000000000 --- a/TAO/examples/AMI/FL_Callback/peer.conf +++ /dev/null @@ -1,3 +0,0 @@ -# $Id$ -# -static Client_Strategy_Factory "-ORBTransportMuxStrategy MUXED" diff --git a/TAO/examples/AMI/FL_Callback/peer.conf.xml b/TAO/examples/AMI/FL_Callback/peer.conf.xml deleted file mode 100644 index b4e94893014..00000000000 --- a/TAO/examples/AMI/FL_Callback/peer.conf.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./examples/AMI/FL_Callback/peer.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- $Id$ --> - <!-- --> - <static id="Client_Strategy_Factory" params="-ORBTransportMuxStrategy MUXED"/> -</ACE_Svc_Conf> diff --git a/TAO/examples/AMI/FL_Callback/peer.cpp b/TAO/examples/AMI/FL_Callback/peer.cpp deleted file mode 100644 index 529143d03f2..00000000000 --- a/TAO/examples/AMI/FL_Callback/peer.cpp +++ /dev/null @@ -1,183 +0,0 @@ -// $Id$ - -#include "Peer_i.h" -#include "ace/Get_Opt.h" -#include "ace/Task.h" -#include "ace/Sched_Params.h" -#include "ace/OS_NS_errno.h" - -ACE_RCSID (FL_Callback, - peer, - "$Id$") - -const char *ior = "file://progress.ior"; -int nthreads = 4; -int interval = 0; // microseconds - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:n:t:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case 'n': - nthreads = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case 't': - interval = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <iorfile>" - "-n <threads>" - "-t <microseconds>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -class Worker : public ACE_Task_Base -{ - // = TITLE - // Run a server thread - // - // = DESCRIPTION - // Use the ACE_Task_Base class to run server threads - // -public: - Worker (CORBA::ORB_ptr orb); - // ctor - - virtual int svc (void); - // The thread entry point. - -private: - CORBA::ORB_var orb_; - // The orb -}; - -int -main (int argc, char *argv[]) -{ - int priority = - (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) - + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; - - priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, - priority); - - priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, - priority); - - // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. - if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "server (%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR ((LM_ERROR, - "server (%P|%t): sched_params failed\n")); - } - - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var progress_object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Progress_var progress = - Progress::_narrow (progress_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Time_Value delay (0, interval); - - Peer_i peer; - peer.init (orb.in (), - progress.in (), - delay - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Worker worker (orb.in ()); - if (worker.activate (THR_NEW_LWP | THR_JOINABLE, - nthreads) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot activate client threads\n"), - 1); - - worker.thr_mgr ()->wait (); - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} - -// **************************************************************** - -Worker::Worker (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -int -Worker::svc (void) -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting event loop\n")); - this->orb_->run (); - return 0; -} diff --git a/TAO/examples/AMI/FL_Callback/progress.cpp b/TAO/examples/AMI/FL_Callback/progress.cpp deleted file mode 100644 index d5d9556a839..00000000000 --- a/TAO/examples/AMI/FL_Callback/progress.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// $Id$ - -#include "Progress_i.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "tao/FlResource_Loader.h" - -ACE_RCSID (FL_Callback, - progress, - "$Id$") - -#include <FL/Fl.h> -#include <FL/Fl_Window.h> - -const char *ior_output_file = "progress.ior"; -int n_iterations = 1000; -int n_peers = 1; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:p:i:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - - case 'p': - n_peers = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case 'i': - n_iterations = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "-p <peers>" - "-i <iterations>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - TAO::FlResource_Loader fl_loader; - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - int w = 320; - int h = 30 * n_peers + 20; - Fl_Window window(w, h); - - Progress_Window sw (n_peers, n_iterations, - 10, - 10, - window.w () - 20, - window.h () - 20); - window.resizable (&sw); - - window.end (); - - char* targv[] = { argv[0] }; - window.show (1, targv); - - sw.show (); - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Progress_i server_impl (&sw); - - Progress_var server = - server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - if (Fl::run () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "Fl::run"), -1); - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/examples/AMI/FL_Callback/test.idl b/TAO/examples/AMI/FL_Callback/test.idl deleted file mode 100644 index 87dead7906d..00000000000 --- a/TAO/examples/AMI/FL_Callback/test.idl +++ /dev/null @@ -1,41 +0,0 @@ -// -// $Id$ -// - -interface Peer; -typedef sequence<Peer> PeerSet; - -interface Peer -{ - // = DESCRIPTION - // A simple interface to demo the AMI implementation. - // A set of "peers" run in the network, each one binds to the - // progress server, when all the peers are bound the server - // requests that each one send multiple "request" messages to each - // other, using AMI. The progress is reported back to the progress - // server for display. - - long request (in long id); - // A simple request, sends back the number in <id>. - - oneway void start (in PeerSet the_peers, - in long iterations); - // Start the demo in one Peer - - oneway void shutdown (); - // Shutdown the ORB -}; - -interface Progress -{ - // = DESCRIPTION - // This interface is used to report progress, multiple - // applications identified by an <id> run in parallel, each one - // reports as the asynchronous requests are sent and received. - - oneway void sent_request (in long id); - oneway void recv_reply (in long id); - - long bind (in Peer a_peer); - // Bind one of the peers. -}; diff --git a/TAO/examples/AMI/Makefile.am b/TAO/examples/AMI/Makefile.am deleted file mode 100644 index 66e37fc0b72..00000000000 --- a/TAO/examples/AMI/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -SUBDIRS = \ - FL_Callback - |