Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / tests / AVStreams / Pluggable_Flow_Protocol / receiver.h
blob872f4213484c874f125c7a2f2a8941d643a63c71
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file receiver.h
7 * This application receives data from a AV sender and writes it to
8 * a file.
10 * @author Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
12 //=============================================================================
15 #include "orbsvcs/Naming/Naming_Client.h"
16 #include "orbsvcs/AV/AVStreams_i.h"
17 #include "orbsvcs/AV/Endpoint_Strategy.h"
18 #include "orbsvcs/AV/Policy.h"
20 /**
21 * @class Receiver_Callback
23 * @brief Application defined callback object.
25 * AVStreams calls this class when data shows up from a sender.
27 class Receiver_Callback : public TAO_AV_Callback
29 public:
30 /// Constructor.
31 Receiver_Callback ();
33 // Method that is called when there is data to be received from a
34 // sender.
35 int receive_frame (ACE_Message_Block *frame,
36 TAO_AV_frame_info *frame_info,
37 const ACE_Addr &peer_address);
39 // Called when the sender is done sending data and wants to close
40 // down the connection.
41 int handle_destroy ();
43 private:
44 /// Keeping a count of the incoming frames.
45 int frame_count_;
48 /**
49 * @class Receiver_StreamEndPoint
51 * @brief Application defined stream endpoint object.
53 * AVStreams calls this class during connection setup.
55 class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
57 public:
58 // Create a receiver application callback.
59 int get_callback (const char *flowname,
60 TAO_AV_Callback *&callback);
62 private:
63 /// Receiver application callback.
64 Receiver_Callback callback_;
67 /**
68 * @class Receiver
70 * @brief Receiver application class.
72 * This class receives data from a AV sender and writes it to
73 * a file.
75 class Receiver
77 public:
78 /// Constructor
79 Receiver ();
81 /// Destructor.
82 ~Receiver ();
84 /// Initialize data components.
85 int init (int argc,
86 ACE_TCHAR *argv[]);
88 protected:
89 /// The Naming Service Client.
90 TAO_Naming_Client naming_client_;
92 /// The endpoint reactive strategy.
93 TAO_AV_Endpoint_Reactive_Strategy_B
94 <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
96 /// Receiver MMDevice.
97 TAO_MMDevice *mmdevice_;