diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-15 04:23:40 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-15 04:23:40 +0000 |
commit | b608d1066a61c3793c879266c93ab0a97b063f4c (patch) | |
tree | 330242725b8b5a464aa612d38ebc38821d20a08d /TAO/examples/Event_Comm/supplier.cpp | |
parent | 43d57c766dfd3d460d9d20264482dfe3a5b1279b (diff) | |
download | ATCD-ACE-4_5_55.tar.gz |
This commit was manufactured by cvs2svn to create tag 'ACE-4_5_55'.ACE-4_5_55
Diffstat (limited to 'TAO/examples/Event_Comm/supplier.cpp')
-rw-r--r-- | TAO/examples/Event_Comm/supplier.cpp | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/TAO/examples/Event_Comm/supplier.cpp b/TAO/examples/Event_Comm/supplier.cpp deleted file mode 100644 index a5d2f7cbb8b..00000000000 --- a/TAO/examples/Event_Comm/supplier.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// $Id$ - -#include "Notifier_Handler.h" -#include "Supplier_Input_Handler.h" - -ACE_RCSID(Supplier, supplier, "$Id$") - -class Supplier : public ACE_Event_Handler -{ - // = TITLE - // Supplier driver for the TAO Publish/Subscribe example. - // - // = DESCRIPTION - // This class starts up the <Supplier_Input_Handler> and <Notifier_Handler> - // objects. -public: - // Initialization and Termination methods. - Supplier (void); - // Constructor. - - ~Supplier (void); - // Destructor. - - int init (int argc, char *argv[]); - // Initialization method. returns 0 on success, -1 on error. - - void run (void); - // Execute the supplier. - -private: - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); - - Supplier_Input_Handler ih_; - // Handler for keyboard input. - - Notifier_Handler nh_; - // The notifier handler. -}; - -Supplier::Supplier (void) - :nh_ (), - ih_ () - -{ - // No-Op. -} - -Supplier::~Supplier (void) -{ - // No-Op. -} - -int -Supplier::handle_signal (int signum, siginfo_t *, ucontext_t *) -{ - ACE_DEBUG ((LM_DEBUG, - "%S\n", - signum)); - - this->ih_.handle_close (); - this->nh_.handle_close (); - - ACE_Reactor::end_event_loop (); - return 0; -} - -void -Supplier::run (void) -{ - if (ACE_Reactor::run_event_loop () == -1) - ACE_ERROR ((LM_ERROR, - "%p\n", - "run_reactor_event_loop")); -} - -int -Supplier::init (int argc, char *argv[]) -{ - if (this->nh_.init (argc, argv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "Notifier_Handler did not init\n"), -1); - - if (this->ih_.initialize (&nh_) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "Supplier Input handler did not init\n"), -1); - - if (ACE_Reactor::instance ()->register_handler (SIGINT, this) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "register_handler"), -1); -} - - - -int -main (int argc, char *argv[]) -{ - // Initialize server daemon. - Supplier supplier; - - if (supplier.init (argc, argv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "supplier init failed"), 1); - - // Loop forever handling events. - supplier.run (); - - return 0; -} |