Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / examples / Callback_Quoter / Notifier_Input_Handler.h
bloba19bbeabf5e1c3aa243f70173fd9cdf50666714a
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Notifier_Input_Handler.h
6 * Definition of the Callback_Quoter Notifier_Input_Handler class.
8 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
9 */
10 //=============================================================================
13 #ifndef SUPPLIER_INPUT_HANDLER_H
14 #define SUPPLIER_INPUT_HANDLER_H
16 #include "Notifier_i.h"
17 #include "NotifierS.h"
18 #include "ace/Event_Handler.h"
19 #include "tao/Utils/ORB_Manager.h"
20 #include "orbsvcs/CosNamingS.h"
21 #include "orbsvcs/Naming/Naming_Client.h"
23 /**
24 * @class Notifier_Input_Handler
26 * @brief The class defines the callback quoter Notifier initialization
27 * and run methods.
29 * This class handles initialization tasks, as well, such as
30 * setting up the Orb manager and registers the Notifier servant
31 * object.
33 class Notifier_Input_Handler : public ACE_Event_Handler
35 public:
36 /// Constructor.
37 Notifier_Input_Handler (void);
39 /// Destructor.
40 ~Notifier_Input_Handler (void);
42 /// Initialize the Notifier who plays the role of the server here.
43 int init (int argc,
44 ACE_TCHAR *argv[]);
46 /// Run the ORB.
47 int run (void);
49 /// Handle the user input.
50 virtual int handle_input (ACE_HANDLE);
52 private:
54 /// The tao orb manager object.
55 TAO_ORB_Manager orb_manager_;
57 /// Parses the command line arguments.
58 int parse_args (void);
60 /// Initialises the name server and registers the Notifier object
61 /// name with the name server.
62 int init_naming_service (void);
64 /// File where the IOR of the Notifier object is stored.
65 FILE *ior_output_file_;
67 /// Number of command line arguments.
68 int argc_;
70 /// The command line arguments.
71 ACE_TCHAR **argv_;
73 /// Naming context for the naming service.
74 CosNaming::NamingContext_var naming_context_;
76 /// helper class for getting access to Naming Service.
77 TAO_Naming_Client naming_server_;
79 /// The servant object registered with the orb.
80 Notifier_i notifier_i_;
82 /// This specifies whether the naming service is to be used.
83 int using_naming_service_;
86 #endif /* NOTIFIER_INPUT_HANDLER_H */