=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / examples / AMI / FL_Callback / Peer_i.h
blob91e6debb5164e0e83ec992f24a8c22b40df82995
2 //=============================================================================
3 /**
4 * @file Peer_i.h
6 * @author Carlos O'Ryan
7 */
8 //=============================================================================
11 #ifndef PEER_I_H
12 #define PEER_I_H
14 #include "testS.h"
15 #include "ace/Task.h"
17 class Peer_i;
19 class Peer_Handler_i : public POA_AMI_PeerHandler
21 public:
22 /// The peer
23 Peer_Handler_i (Peer_i *peer);
25 virtual void request (CORBA::Long retval);
27 virtual void request_excep (::Messaging::ExceptionHolder * excep_holder);
29 virtual void start ();
31 virtual void shutdown ();
33 private:
34 /// The real implementation
35 Peer_i *peer_;
38 class Peer_i : public POA_Peer
40 public:
41 /// Constructor
42 Peer_i ();
44 /// Destructor
45 virtual ~Peer_i ();
47 void init (CORBA::ORB_ptr orb,
48 Progress_ptr progress,
49 const ACE_Time_Value &delay);
51 /// Used by the Reply_Handler to indicate that a reply has been
52 /// received.
53 void reply (CORBA::Long result);
55 // = See test.idl for an explanation of these methods.
56 CORBA::Long request (CORBA::Long id);
58 void start (const PeerSet& the_peers,
59 CORBA::Long iterations);
61 void shutdown ();
63 private:
64 /// The reply_handler
65 Peer_Handler_i reply_handler_;
67 /// The orb
68 CORBA::ORB_var orb_;
70 /// The interface to report back progress.
71 Progress_var progress_;
73 /// The delay on each request
74 ACE_Time_Value delay_;
76 /// The id assigned by the progress interface
77 CORBA::Long id_;
80 /**
81 * @class Peer_Task
83 * Run a "start" request on a separate thread.
85 class Peer_Task : public ACE_Task_Base
87 public:
88 Peer_Task (const PeerSet& the_peers,
89 CORBA::Long iterations,
90 Progress_ptr progress,
91 AMI_PeerHandler_ptr handler,
92 CORBA::Long id);
94 /// The thread entry point
95 virtual int svc ();
97 private:
98 /// The peers
99 PeerSet the_peers_;
101 /// The number of iterations
102 CORBA::Long iterations_;
104 /// To report progress
105 Progress_var progress_;
107 /// To issue async requests
108 AMI_PeerHandler_var handler_;
110 /// Our id
111 CORBA::Long id_;
114 #endif /* PEER_I_H */