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.
28 class Consumer_Handler
;
31 * @class Consumer_Input_Handler
33 * @brief Callback Quoter Consumer Client class.
35 * Connects to the Callback Quoter server and
36 * registers the Consumer object with the it
37 * and receives the stock status from the Notifier.
39 class Consumer_Input_Handler
: public ACE_Event_Handler
43 Consumer_Input_Handler (Consumer_Handler
*consumer_handler
);
45 /// Handle the user input.
46 int handle_input (ACE_HANDLE
) override
;
48 /// Registration with the notifier.
49 int register_consumer ();
51 /// Cancelling the registration with the notifier.
52 int unregister_consumer ();
54 /// Ends the consumer process.
55 int quit_consumer_process ();
57 /// A set of values for the execution of the consumer.
59 /// Used so that the process of registering, unregistering
60 /// and exiting neednt be dependent on 'r' 'u' and 'q'.
61 /// Also, #define clutters up the global namespace.
64 /// The character that the user must type to register the consumer with
65 /// the Notifier_server.
68 /// The character that the user must type to unregister the consumer with
69 /// the Notifier_server.
72 /// The character the user must type to quit the consumer client
79 ~Consumer_Input_Handler () = default;
82 /// The Consumer_Handler object.
83 Consumer_Handler
*consumer_handler_
;
86 #endif /* CONSUMER_INPUT_HANDLER_H */