Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / examples / Event_Comm / Notifier_Handler.h
blobd231084f1b3977567f8e5ca714b8f9934b41cba6
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Notifier_Handler.h
7 * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) and Pradeep Gore (pradeep@cs.wustl.edu)
8 */
9 //=============================================================================
12 #ifndef _NOTIFIER_HANDLER_H
13 #define _NOTIFIER_HANDLER_H
15 #include "Event_Comm_i.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "orbsvcs/Naming/Naming_Client.h"
22 #include "orbsvcs/CosNamingC.h"
24 /**
25 * @class Notifier_Handler
27 * @brief Holds the <Event_Comm::Notifier> object which is obtained from
28 * the naming service.
30 class Notifier_Handler
32 public:
33 /// This constructor gets the notifier object from the Naming
34 /// Service.
35 Notifier_Handler (void);
37 /// Destructor.
38 virtual ~Notifier_Handler (void);
40 /// Initialize the client communication endpoint with server.
41 int init (int argc, ACE_TCHAR *argv[], ShutdownCallback* _shutdowncallback);
43 // = Accessors.
44 Event_Comm::Notifier *notifier (void);
45 void notifier (Event_Comm::Notifier *);
47 /// runs the ORB.
48 int run (void);
50 /// Close down the handler.
51 int close (void);
53 /// called to request application shutdown.
54 void shutdown (void);
56 /// returns the ORB's reactor.
57 ACE_Reactor *reactor (void);
59 private:
60 /// Remember our orb.
61 CORBA::ORB_var orb_;
63 /// Pointer to an <Event_Comm::Notifier> object.
64 Event_Comm::Notifier *notifier_;
66 /// An instance of the name client used for resolving the factory
67 /// objects.
68 TAO_Naming_Client naming_client_;
70 /// The handler to shutdown the app.
71 ShutdownCallback *shutdowncallback;
74 #define NOTIFIER_BIND_NAME "Notifier"
76 #endif /* _NOTIFIER_HANDLER_H */