Merge pull request #2324 from jwillemsen/jwi-depcopydisabled
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / StubFaultConsumer.h
blob89500455fd8f62e187a433ab0a078f0bd5a9127e
1 // -*- C++ -*-
2 #ifndef STUBFAULTCONSUMER_H
3 #define STUBFAULTCONSUMER_H
4 #include /**/ <ace/pre.h>
5 #include <ace/ACE.h>
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #pragma once
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #include "orbsvcs/CosNotifyChannelAdminS.h"
12 #include <orbsvcs/FT_NotifierC.h>
14 #include "ace/SString.h"
17 //////////////////////
18 // Forward references
20 /////////////////////
21 // Class declarations
23 /**
24 * A stub fault consumer for use in unit testing Fault Notifier.
26 class StubFaultConsumer
27 : public virtual POA_CosNotifyComm::StructuredPushConsumer
29 public:
30 /**
31 * Default constructor.
33 StubFaultConsumer ();
35 /**
36 * virtual destructor.
38 virtual ~StubFaultConsumer ();
41 ::PortableServer::POA_ptr _default_POA ();
42 ::PortableServer::ObjectId objectId()const;
44 /**
45 * Parse command line arguments.
47 int parse_args (int argc, ACE_TCHAR * argv[]);
49 /**
50 * Publish this objects IOR.
52 int init (CORBA::ORB_ptr orb, ::FT::FaultNotifier_var & notifier);
54 /**
55 * Return a string to identify this object for logging/console message purposes.
57 const char * identity () const;
59 /**
60 * idle time activity.
61 * @param result [out] status code to return from process
62 * @returns 0 to continue; nonzero to quit
64 int idle(int &result);
66 /**
67 * Clean house for process shut down.
69 int fini ();
72 size_t notifications() const;
74 public:
75 ////////////////
76 // CORBA methods
77 virtual void push_structured_event(
78 const CosNotification::StructuredEvent &notification);
80 virtual void offer_change (
81 const CosNotification::EventTypeSeq & added,
82 const CosNotification::EventTypeSeq & removed);
84 virtual void disconnect_structured_push_consumer();
86 ////////////////////
87 // Forbidden methods
88 private:
89 StubFaultConsumer (const StubFaultConsumer & rhs);
90 StubFaultConsumer & operator = (const StubFaultConsumer & rhs);
92 /////////////////////////
93 // Implementation methods
94 private:
95 ///////////////
96 // Data Members
97 private:
98 /**
99 * The orb
101 CORBA::ORB_var orb_;
104 * The POA used to activate this object.
106 PortableServer::POA_var poa_;
109 * The CORBA object id assigned to this object.
111 PortableServer::ObjectId_var object_id_;
115 * A human-readable string to distinguish this from other FaultConsumers.
117 ACE_CString identity_;
120 * boolean: request quit
122 int quit_;
125 * the notifier
127 ::FT::FaultNotifier_var notifier_;
130 * consumer id assigned by the notifier
132 ::FT::FaultNotifier::ConsumerId consumer_id_;
134 size_t notifications_;
137 #include /**/ <ace/post.h>
139 #endif /* STUBFAULTCONSUMER_H */