Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / examples / Log / Event / Event_Consumer.h
blob1117e907a81ed437ddaf39e831f8638745cd8b58
1 /* -*- C++ -*- */
3 // ============================================================================
4 /**
5 * @file Event_Consumer.h
7 * An example of using the Event_Logging_Service.
8 * The Event_Consumer consumes log-generated events.
10 * @author D A Hanvey (d.hanvey@qub.ac.uk)
12 // ============================================================================
14 #ifndef EVENT_CONSUMER_H
15 #define EVENT_CONSUMER_H
17 #include "orbsvcs/DsEventLogAdminC.h"
18 #include "orbsvcs/CosEventCommS.h"
19 #include "orbsvcs/CosNamingC.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 class Consumer : public POA_CosEventComm::PushConsumer
27 // = TITLE
28 // Simple consumer object
30 // = DESCRIPTION
31 // This class is a consumer of log generated events.
33 public:
34 Consumer (void);
35 // Constructor
37 int run (int argc, ACE_TCHAR* argv[]);
38 // Run the test
40 // = The CosEventComm::PushConsumer methods
42 virtual void push (const CORBA::Any &event);
44 virtual void disconnect_push_consumer (void);
45 // The skeleton methods.
47 private:
49 // = Data Members
50 CORBA::ULong event_count_;
51 // Keep track of the number of events received.
53 CORBA::ORB_var orb_;
54 // The orb, just a pointer because the ORB does not outlive the
55 // run() method...
57 CosNaming::NamingContext_var naming_context_;
58 // Handle to the name service.
60 DsEventLogAdmin::EventLogFactory_var event_log_factory_;
61 // The Event Log Factory that generates the events to be consumed.
63 CosEventChannelAdmin::ProxyPushSupplier_var supplier_;
64 // The proxy that we are connected to.
68 #endif /* EVENT_CONSUMER_H */