Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / examples / Callback_Quoter / Notifier_Input_Handler.h
blobe26fa584eba114438a3740073c10b22e91189a98
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 ();
39 /// Destructor.
40 ~Notifier_Input_Handler ();
42 /// Initialize the Notifier who plays the role of the server here.
43 int init (int argc, ACE_TCHAR *argv[]);
45 /// Run the ORB.
46 int run ();
48 /// Handle the user input.
49 int handle_input (ACE_HANDLE) override;
51 private:
52 /// The TAO orb manager object.
53 TAO_ORB_Manager orb_manager_;
55 /// Parses the command line arguments.
56 int parse_args ();
58 /// Initialises the name server and registers the Notifier object
59 /// name with the name server.
60 int init_naming_service ();
62 /// File where the IOR of the Notifier object is stored.
63 FILE *ior_output_file_;
65 /// Number of command line arguments.
66 int argc_;
68 /// The command line arguments.
69 ACE_TCHAR **argv_;
71 /// Naming context for the naming service.
72 CosNaming::NamingContext_var naming_context_;
74 /// helper class for getting access to Naming Service.
75 TAO_Naming_Client naming_server_;
77 /// The servant object registered with the orb.
78 Notifier_i notifier_i_;
80 /// This specifies whether the naming service is to be used.
81 int using_naming_service_;
84 #endif /* NOTIFIER_INPUT_HANDLER_H */