00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TAO_AV_ENDPOINT_STRATEGY_T_H
00015 #define TAO_AV_ENDPOINT_STRATEGY_T_H
00016 #include "ace/pre.h"
00017
00018 #include "orbsvcs/AV/Endpoint_Strategy.h"
00019
00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00021
00022
00023
00024
00025
00026 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00027 class TAO_AV_Endpoint_Reactive_Strategy
00028 : public TAO_AV_Endpoint_Strategy
00029 {
00030
00031 protected:
00032
00033
00034
00035 TAO_AV_Endpoint_Reactive_Strategy (void);
00036
00037
00038 virtual ~TAO_AV_Endpoint_Reactive_Strategy (void);
00039
00040
00041 virtual int activate (void);
00042
00043
00044 virtual int activate_stream_endpoint (void) = 0;
00045
00046
00047 virtual int activate_vdev (void);
00048
00049
00050 virtual int activate_mediactrl (void);
00051
00052
00053
00054 virtual int make_vdev (T_VDev *&vdev);
00055
00056
00057
00058 virtual int make_stream_endpoint (T_StreamEndpoint *&stream_endpoint);
00059
00060
00061
00062 virtual int make_mediactrl (T_MediaCtrl *&media_ctrl);
00063
00064
00065 char* activate_with_poa (PortableServer::Servant servant);
00066
00067 CORBA::ORB_var orb_;
00068
00069 PortableServer::POA_var poa_;
00070
00071 CORBA::Object_var media_ctrl_obj_;
00072
00073 T_StreamEndpoint *stream_endpoint_a_servant_;
00074
00075 T_StreamEndpoint *stream_endpoint_b_servant_;
00076
00077 T_VDev *vdev_servant_;
00078
00079 T_MediaCtrl *media_ctrl_servant_;
00080 };
00081
00082
00083
00084
00085
00086
00087 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00088 class TAO_AV_Endpoint_Reactive_Strategy_A
00089 : public TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev , T_MediaCtrl>
00090 {
00091
00092 public:
00093
00094 TAO_AV_Endpoint_Reactive_Strategy_A (void);
00095
00096
00097 int init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
00098
00099
00100 virtual ~TAO_AV_Endpoint_Reactive_Strategy_A (void);
00101
00102
00103
00104 virtual int activate_stream_endpoint (void);
00105
00106
00107 virtual int create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
00108 AVStreams::VDev_ptr &vdev);
00109
00110 };
00111
00112
00113
00114
00115
00116
00117 template <class T_StreamEndpoint, class T_Vdev , class T_MediaCtrl>
00118 class TAO_AV_Endpoint_Reactive_Strategy_B
00119 : public TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_Vdev, T_MediaCtrl>
00120 {
00121
00122 public:
00123
00124
00125 TAO_AV_Endpoint_Reactive_Strategy_B (void);
00126
00127
00128 virtual ~TAO_AV_Endpoint_Reactive_Strategy_B (void);
00129
00130 int init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
00131
00132
00133
00134 virtual int activate_stream_endpoint (void);
00135
00136
00137 virtual int create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
00138 AVStreams::VDev_ptr &vdev);
00139 };
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00150 class TAO_AV_Child_Process
00151 {
00152
00153 public:
00154
00155 TAO_AV_Child_Process ();
00156
00157
00158 virtual ~TAO_AV_Child_Process ();
00159
00160
00161
00162 int init (int argc, char **argv, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
00163
00164
00165 int run (ACE_Time_Value *tv = 0);
00166
00167 protected:
00168
00169
00170
00171
00172
00173 int activate_objects (int argc,
00174 char **argv);
00175
00176
00177 char* activate_with_poa (PortableServer::Servant servant);
00178
00179
00180 int unbind_names (void);
00181
00182
00183 int bind_to_naming_service (void);
00184
00185
00186 int register_vdev (void);
00187
00188
00189 int register_stream_endpoint (void);
00190
00191
00192 int release_semaphore ();
00193
00194
00195
00196 virtual int make_vdev (T_VDev *&vdev);
00197
00198
00199
00200 virtual int make_stream_endpoint (T_StreamEndpoint *&stream_endpoint);
00201
00202
00203
00204 virtual int make_mediactrl (T_MediaCtrl *&media_ctrl);
00205
00206
00207 CosNaming::NamingContext_var naming_context_;
00208
00209
00210 CosNaming::Name vdev_name_;
00211
00212
00213 CosNaming::Name stream_endpoint_name_;
00214
00215
00216 T_StreamEndpoint *stream_endpoint_;
00217
00218
00219 T_VDev *vdev_;
00220
00221
00222 CORBA::Object_var vdev_obj_;
00223
00224
00225 T_MediaCtrl *media_ctrl_;
00226
00227
00228 CORBA::Object_var media_ctrl_obj_;
00229
00230
00231 pid_t pid_;
00232
00233
00234 char host_[MAXHOSTNAMELEN];
00235
00236 CORBA::ORB_ptr orb_;
00237
00238 PortableServer::POA_ptr poa_;
00239
00240 };
00241
00242
00243
00244
00245
00246
00247 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00248 class TAO_AV_Child_Process_A
00249 : public TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>
00250 {
00251
00252 public:
00253
00254 TAO_AV_Child_Process_A (void);
00255
00256
00257 virtual ~TAO_AV_Child_Process_A (void);
00258 };
00259
00260
00261
00262
00263
00264
00265
00266 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00267 class TAO_AV_Child_Process_B
00268 : public TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>
00269 {
00270
00271 public:
00272
00273 TAO_AV_Child_Process_B (void);
00274
00275
00276 virtual ~TAO_AV_Child_Process_B (void);
00277 };
00278
00279 TAO_END_VERSIONED_NAMESPACE_DECL
00280
00281 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00282 #include "orbsvcs/AV/Endpoint_Strategy_T.cpp"
00283 #endif
00284
00285 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00286 #pragma implementation ("Endpoint_Strategy_T.cpp")
00287 #endif
00288
00289 #include "ace/post.h"
00290 #endif