3 //=============================================================================
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)
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
;
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
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);
62 // A set of values for the execution of the consumer.
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.
70 // The character that the user must type to register the consumer with
71 // the Notifier_server.
74 // The character that the user must type to unregister the consumer with
75 // the Notifier_server.
78 // The character the user must type to quit the consumer client
84 ~Consumer_Input_Handler (void);
87 /// The Consumer_Handler object.
88 Consumer_Handler
*consumer_handler_
;
91 #endif /* CONSUMER_INPUT_HANDLER_H */