Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / examples / Callback_Quoter / Consumer_Input_Handler.h
blob883673c2251a5971f174b4ee29d7e4b9b4abed53
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Consumer_Input_Handler.h
7 * Definition of the Callback_Qouter Consumer Client class, Consumer_Input_Handler.
9 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
11 //=============================================================================
14 #ifndef CONSUMER_INPUT_HANDLER_H
15 #define CONSUMER_INPUT_HANDLER_H
17 #include "ace/Reactor.h"
18 #include "ace/Event_Handler.h"
19 #include "Consumer_Handler.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 // Creating a class to handle input events.
26 // Since only inputs need to be handled, only the handle_input
27 // method is overlaoded.
29 class Consumer_Handler;
31 /**
32 * @class Consumer_Input_Handler
34 * @brief Callback Quoter Consumer Client class.
36 * Connects to the Callback Quoter server and
37 * registers the Consumer object with the it
38 * and receives the stock status from the Notifier.
40 class Consumer_Input_Handler : public ACE_Event_Handler
43 public:
44 /// Constructor.
45 Consumer_Input_Handler (Consumer_Handler *consumer_handler);
47 /// Handle the user input.
48 int handle_input (ACE_HANDLE);
50 /// Registration with the notifier.
51 int register_consumer (void);
53 /// Cancelling the registration with the notifier.
54 int unregister_consumer (void);
56 /// Ends the consumer process.
57 int quit_consumer_process (void);
59 enum
61 // = TITLE
62 // A set of values for the execution of the consumer.
64 // = DESCRIPTION
65 // Used so that the process of registering, unregistering
66 // and exiting neednt be dependent on 'r' 'u' and 'q'.
67 // Also, #define clutters up the global namespace.
69 REGISTER = 'r',
70 // The character that the user must type to register the consumer with
71 // the Notifier_server.
73 UNREGISTER = 'u',
74 // The character that the user must type to unregister the consumer with
75 // the Notifier_server.
77 EXIT = 'q'
78 // The character the user must type to quit the consumer client
79 // application.
82 protected:
83 /// the destructor.
84 ~Consumer_Input_Handler (void);
86 private:
87 /// The Consumer_Handler object.
88 Consumer_Handler *consumer_handler_;
91 #endif /* CONSUMER_INPUT_HANDLER_H */