Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / tests / AVStreams / Latency / ping.h
blob70e3d743bef060feca6d7fe9c333b41ea1adda11
2 //=============================================================================
3 /**
4 * @file ping.h
6 * @author Carlos O'Ryan
7 */
8 //=============================================================================
11 #ifndef TAO_PING_H
12 #define TAO_PING_H
14 #include "orbsvcs/AV/AVStreams_i.h"
15 #include "orbsvcs/AV/Policy.h"
16 #include "orbsvcs/AV/Flows_T.h"
17 #include "ace/OS_NS_time.h"
19 class Ping_Recv_Callback : public TAO_AV_Callback
21 public:
22 Ping_Recv_Callback ();
23 virtual int handle_stop ();
24 virtual int receive_frame (ACE_Message_Block *frame,
25 TAO_AV_frame_info *frame_info = 0,
26 const ACE_Addr &peer_address = ACE_Addr::sap_any);
27 virtual int handle_destroy ();
28 protected:
29 int count_;
32 class Ping_Recv : public TAO_FlowConsumer
34 public:
35 Ping_Recv ();
37 virtual int get_callback (const char *flowname,
38 TAO_AV_Callback *&callback);
40 private:
41 /// The callback object...
42 Ping_Recv_Callback callback_;
45 class Pong_Send_Callback : public TAO_AV_Callback
47 public:
48 /// Ad-hoc method to send a response outside the context of a
49 /// handle_timeout.
50 int send_response (ACE_hrtime_t stamp);
52 virtual int handle_timeout (void *arg);
53 virtual int handle_end_stream ();
54 virtual void get_timeout (ACE_Time_Value *&tv,
55 void *&arg);
58 class Pong_Send : public TAO_FlowProducer
60 public:
61 Pong_Send ();
62 virtual int get_callback (const char *flowname,
63 TAO_AV_Callback *&callback);
66 typedef TAO_AV_Endpoint_Reactive_Strategy_B <TAO_StreamEndPoint_B,TAO_VDev,AV_Null_MediaCtrl> Reactive_Strategy;
68 typedef TAO_FDev<TAO_FlowProducer,Ping_Recv> Ping_Recv_FDev;
69 typedef TAO_FDev<Pong_Send,TAO_FlowConsumer> Pong_Send_FDev;
71 #endif /* TAO_PING_H */