Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / AVStreams / Pluggable_Flow_Protocol / sender.h
blob806320d3b2d93fa691a74f2adf70cea28baeb54e
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file sender.h
7 * This application reads data from a file and sends it to s
8 * receiver.
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/Protocol_Factory.h"
20 /**
21 * @class Sender_StreamEndPoint
23 * @brief Defines a sender stream endpoint.
25 class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
27 public:
28 /// Create the application callback and return its handle to
29 /// AVStreams for further application callbacks.
30 int get_callback (const char *flowname,
31 TAO_AV_Callback *&callback);
33 /// Set protocol object corresponding to the transport protocol
34 /// chosen.
35 int set_protocol_object (const char *flowname,
36 TAO_AV_Protocol_Object *object);
38 protected:
39 /// Application callback.
40 TAO_AV_Callback callback_;
43 typedef TAO_AV_Endpoint_Reactive_Strategy_A
44 <Sender_StreamEndPoint,
45 TAO_VDev,
46 AV_Null_MediaCtrl>
47 SENDER_ENDPOINT_STRATEGY;
49 /**
50 * @class Sender
52 * @brief Sender Application.
54 * Class is responsible for streaming (and pacing) data to a
55 * receiver.
57 class Sender
59 public:
60 /// Constructor
61 Sender ();
63 /// Method to initialize the various data components.
64 int init (int argc,
65 ACE_TCHAR *argv[]);
67 /// Method to pace and send data from a file.
68 int pace_data ();
70 /// Set the protocol object corresponding to the transport protocol chosen.
71 void protocol_object (TAO_AV_Protocol_Object *protocol_object);
73 private:
74 /// Method to parse the command line arguments.
75 int parse_args (int argc, ACE_TCHAR *argv[]);
77 /// Method that binds the sender to the receiver.
78 int bind_to_receiver ();
80 /// The endpoint strategy used by the sender.
81 SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
83 /// The receiver MMDevice that the sender connects to.
84 AVStreams::MMDevice_var receiver_mmdevice_;
86 /// The sender MMDevice.
87 TAO_MMDevice *sender_mmdevice_;
89 /// Stream controller
90 TAO_StreamCtrl *streamctrl_;
92 /// Number of frames sent.
93 int frame_count_;
95 /// File from which data is read.
96 ACE_CString filename_;
98 /// The Naming Service client.
99 TAO_Naming_Client naming_client_;
101 /// File handle of the file read from.
102 FILE *input_file_;
104 /// Selected protocol - default is UDP
105 ACE_CString protocol_;
107 /// Rate at which the data will be sent.
108 int frame_rate_;
110 /// Message block into which data is read from a file and then sent.
111 ACE_Message_Block mb_;
113 /// Protocol object corresponding to the transport protocol selected.
114 TAO_AV_Protocol_Object *protocol_object_;