Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / examples / Log / Notify / Notify_Consumer.h
blob4357cc56362c0869dded2cd77bc65b32d773454a
1 /* -*- C++ -*- */
3 // ============================================================================
4 /**
5 * @file Notify_Consumer.h
7 * An example of using the Notify_Logging_Service.
8 * The Notify_Consumer consumes log-generated events.
10 * @author D A Hanvey (d.hanvey@qub.ac.uk)
12 // ============================================================================
14 #ifndef NOTIFY_CONSUMER_H
15 #define NOTIFY_CONSUMER_H
17 #include "orbsvcs/DsNotifyLogAdminS.h"
18 #include "orbsvcs/DsEventLogAdminC.h"
19 #include "orbsvcs/CosEventCommS.h"
20 #include "orbsvcs/CosNotifyCommS.h"
21 #include "orbsvcs/CosNamingC.h"
23 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 # pragma once
25 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 class Consumer
28 : public POA_CosNotifyComm::PushConsumer
30 // = TITLE
31 // Simple consumer object
33 // = DESCRIPTION
34 // This class is a consumer of log generated events.
36 public:
37 Consumer (void);
38 // Constructor
40 int run (int argc, ACE_TCHAR* argv[]);
41 // Run the test
43 protected:
44 CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
45 // The proxy_supplier id.
47 // = Methods
49 // = NotifyPublish method
50 virtual void offer_change (
51 const CosNotification::EventTypeSeq & added,
52 const CosNotification::EventTypeSeq & removed);
54 // = StructuredPushSupplier methods
55 virtual void push (const CORBA::Any &event);
58 virtual void disconnect_push_consumer ();
60 private:
61 CORBA::ULong event_count_;
62 // Keep track of the number of events received.
64 // = Data Members
65 CORBA::ORB_var orb_;
66 // The ORB that we use.
68 CosNaming::NamingContext_var naming_context_;
69 // Handle to the name service.
71 DsNotifyLogAdmin::NotifyLogFactory_var notify_log_factory_;
73 CosNotifyChannelAdmin::ProxyPushSupplier_var proxy_supplier_;
78 #endif /* NOTIFY_CONSUMER_H */