TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl > Class Template Reference

Reactive strategy base class. More...

#include <Endpoint_Strategy_T.h>

Inheritance diagram for TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >:

Inheritance graph
[legend]
Collaboration diagram for TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

 TAO_AV_Endpoint_Reactive_Strategy (void)
 Constructor.

virtual ~TAO_AV_Endpoint_Reactive_Strategy (void)
 Destructor.

virtual int activate (void)
 creates and activates the streamendpoint, vdev, and mediacontrol

virtual int activate_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL)=0
 activates the stream_endpoint with the POA

virtual int activate_vdev (ACE_ENV_SINGLE_ARG_DECL)
 activates the vdev with the POA

virtual int activate_mediactrl (ACE_ENV_SINGLE_ARG_DECL)
 activates the media controller with the POA

virtual int make_vdev (T_VDev *&vdev)
virtual int make_stream_endpoint (T_StreamEndpoint *&stream_endpoint)
virtual int make_mediactrl (T_MediaCtrl *&media_ctrl)
char * activate_with_poa (PortableServer::Servant servant ACE_ENV_ARG_DECL)

Protected Attributes

CORBA::ORB_var orb_
PortableServer::POA_var poa_
CORBA::Object_var media_ctrl_obj_
T_StreamEndpoint * stream_endpoint_a_servant_
T_StreamEndpoint * stream_endpoint_b_servant_
T_VDev * vdev_servant_
T_MediaCtrl * media_ctrl_servant_

Detailed Description

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
class TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >

Reactive strategy base class.

Definition at line 27 of file Endpoint_Strategy_T.h.


Constructor & Destructor Documentation

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::TAO_AV_Endpoint_Reactive_Strategy void   )  [protected]
 

Constructor.

Definition at line 21 of file Endpoint_Strategy_T.cpp.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::~TAO_AV_Endpoint_Reactive_Strategy void   )  [protected, virtual]
 

Destructor.

Definition at line 28 of file Endpoint_Strategy_T.cpp.

References ACE_CATCHALL, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_TRY, and ACE_TRY_CHECK.

00029 {
00030   // Do not allow exceptions to escape from the destructor
00031   ACE_DECLARE_NEW_CORBA_ENV;
00032   ACE_TRY
00033     {
00034       if(this->stream_endpoint_a_servant_ )
00035         {
00036           stream_endpoint_a_servant_->_remove_ref (
00037             ACE_ENV_SINGLE_ARG_PARAMETER);
00038           ACE_TRY_CHECK;
00039         }
00040 
00041       if(this->stream_endpoint_b_servant_)
00042         {
00043           stream_endpoint_b_servant_->_remove_ref (
00044             ACE_ENV_SINGLE_ARG_PARAMETER);
00045           ACE_TRY_CHECK;
00046         }
00047 
00048       if(this->vdev_servant_)
00049         {
00050           vdev_servant_->_remove_ref (
00051             ACE_ENV_SINGLE_ARG_PARAMETER);
00052           ACE_TRY_CHECK;
00053         }
00054 
00055       if(this->media_ctrl_servant_)
00056         {
00057           media_ctrl_servant_->_remove_ref (
00058             ACE_ENV_SINGLE_ARG_PARAMETER);
00059           ACE_TRY_CHECK;
00060         }
00061     }
00062   ACE_CATCHANY
00063     {
00064     }
00065 # if defined (ACE_HAS_EXCEPTIONS) \
00066      && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS)
00067   ACE_CATCHALL
00068     {
00069     }
00070 # endif  /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */
00071   ACE_ENDTRY;
00072 
00073 }


Member Function Documentation

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::activate void   )  [protected, virtual]
 

creates and activates the streamendpoint, vdev, and mediacontrol

Definition at line 78 of file Endpoint_Strategy_T.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_DEBUG, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, LM_DEBUG, and TAO_debug_level.

Referenced by TAO_AV_Endpoint_Reactive_Strategy_A< T_StreamEndpoint, T_VDev, T_MediaCtrl >::create_A().

00079 {
00080   ACE_DECLARE_NEW_CORBA_ENV;
00081   ACE_TRY
00082     {
00083       this->activate_stream_endpoint (ACE_ENV_SINGLE_ARG_PARAMETER);
00084       ACE_TRY_CHECK;
00085       if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated stream_endpoint\n"));
00086 
00087       this->activate_vdev (ACE_ENV_SINGLE_ARG_PARAMETER);
00088       ACE_TRY_CHECK;
00089       if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated vdev\n"));
00090 
00091       this->activate_mediactrl (ACE_ENV_SINGLE_ARG_PARAMETER);
00092       ACE_TRY_CHECK;
00093       if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated mediactrl\n"));
00094     }
00095   ACE_CATCHANY
00096     {
00097       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Reactive_Strategy::activate");
00098       return -1;
00099     }
00100   ACE_ENDTRY;
00101   ACE_CHECK_RETURN (-1);
00102   return 0;
00103 }

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::activate_mediactrl ACE_ENV_SINGLE_ARG_DECL   )  [protected, virtual]
 

activates the media controller with the POA

Definition at line 166 of file Endpoint_Strategy_T.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, and ACE_TRY_CHECK.

00167 {
00168   ACE_TRY
00169     {
00170       // Bridge pattern. Subclasses can override this
00171       if (this->make_mediactrl ( media_ctrl_servant_ ) == -1)
00172         return -1;
00173 
00174       // Associate the media controller object reference with the vdev, as per the OMG spec
00175       CORBA::Any anyval;
00176       media_ctrl_obj_
00177         = media_ctrl_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
00178       ACE_TRY_CHECK;
00179 
00180       anyval <<= media_ctrl_obj_.in();
00181 
00182       ACE_TRY_CHECK;
00183 
00184      this->vdev_->define_property ("Related_MediaCtrl",
00185                                    anyval
00186                                    ACE_ENV_ARG_PARAMETER);
00187 
00188       ACE_TRY_CHECK;
00189     }
00190   ACE_CATCHANY
00191     {
00192       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy::activate_mediactrl");
00193       return -1;
00194     }
00195   ACE_ENDTRY;
00196   ACE_CHECK_RETURN (-1);
00197   return 0;
00198 }

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
virtual int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::activate_stream_endpoint ACE_ENV_SINGLE_ARG_DECL   )  [protected, pure virtual]
 

activates the stream_endpoint with the POA

Implemented in TAO_AV_Endpoint_Reactive_Strategy_A< T_StreamEndpoint, T_VDev, T_MediaCtrl >, and TAO_AV_Endpoint_Reactive_Strategy_B< T_StreamEndpoint, T_Vdev, T_MediaCtrl >.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::activate_vdev ACE_ENV_SINGLE_ARG_DECL   )  [protected, virtual]
 

activates the vdev with the POA

Definition at line 132 of file Endpoint_Strategy_T.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, and ACE_TRY_CHECK.

00133 {
00134   ACE_TRY
00135     {
00136       // Bridge pattern. Allow subclasses to override this behavior
00137       T_VDev *vdev = 0;
00138       if (this->make_vdev (vdev) == -1)
00139         return -1;
00140 
00141       // Activate the object under the root poa.
00142 //      CORBA::String_var vdev_ior = this->activate_with_poa (vdev,
00143 //                                                            ACE_ENV_ARG_PARAMETER);
00144 //      ACE_TRY_CHECK;
00145 //      if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activate_vdev, vdev ior is:%s\n",
00146 //                  vdev_ior. in ()));
00147 
00148       // Save the object reference, so that create_A can return it
00149       this->vdev_ = vdev->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
00150       ACE_TRY_CHECK;
00151     }
00152   ACE_CATCHANY
00153     {
00154       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy::activate_vdev");
00155       return -1;
00156     }
00157   ACE_ENDTRY;
00158   ACE_CHECK_RETURN (-1);
00159   return 0;
00160 }

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
char * TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::activate_with_poa PortableServer::Servant servant  ACE_ENV_ARG_DECL  )  [protected]
 

Definition at line 107 of file Endpoint_Strategy_T.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, and ACE_ENV_ARG_PARAMETER.

00108 {
00109 
00110   PortableServer::ObjectId_var id =
00111     this->poa_->activate_object (servant
00112                                  ACE_ENV_ARG_PARAMETER);
00113   ACE_CHECK_RETURN (0);
00114 
00115   CORBA::Object_var obj =
00116     this->poa_->id_to_reference (id.in ()
00117                                  ACE_ENV_ARG_PARAMETER);
00118   ACE_CHECK_RETURN (0);
00119 
00120   CORBA::String_var str =
00121     this->orb_->object_to_string (obj.in ()
00122                                   ACE_ENV_ARG_PARAMETER);
00123   ACE_CHECK_RETURN (0);
00124 
00125   return str._retn ();
00126 }

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::make_mediactrl T_MediaCtrl *&  media_ctrl  )  [protected, virtual]
 

Bridge method to create a media_ctrl, a la Acceptor. Applications can override this

Definition at line 225 of file Endpoint_Strategy_T.cpp.

References ACE_NEW_RETURN.

00226 {
00227   ACE_NEW_RETURN (media_ctrl,
00228                   T_MediaCtrl,
00229                   -1);
00230   return 0;
00231 }

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::make_stream_endpoint T_StreamEndpoint *&  stream_endpoint  )  [protected, virtual]
 

Bridge method to create a stream_endpoint, a la Acceptor. Applications can override this

Definition at line 203 of file Endpoint_Strategy_T.cpp.

References ACE_NEW_RETURN.

00204 {
00205   ACE_NEW_RETURN (stream_endpoint,
00206                   T_StreamEndpoint,
00207                   -1);
00208   return 0;
00209 }

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
int TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::make_vdev T_VDev *&  vdev  )  [protected, virtual]
 

Bridge method to create a vdev, a la Acceptor. Applications can override this

Definition at line 214 of file Endpoint_Strategy_T.cpp.

References ACE_NEW_RETURN.

00215 {
00216   ACE_NEW_RETURN (vdev,
00217                   T_VDev,
00218                   -1);
00219   return 0;
00220 }


Member Data Documentation

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
CORBA::Object_var TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::media_ctrl_obj_ [protected]
 

Definition at line 71 of file Endpoint_Strategy_T.h.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
T_MediaCtrl* TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::media_ctrl_servant_ [protected]
 

Definition at line 79 of file Endpoint_Strategy_T.h.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
CORBA::ORB_var TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::orb_ [protected]
 

Definition at line 67 of file Endpoint_Strategy_T.h.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
PortableServer::POA_var TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::poa_ [protected]
 

Definition at line 69 of file Endpoint_Strategy_T.h.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
T_StreamEndpoint* TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::stream_endpoint_a_servant_ [protected]
 

Definition at line 73 of file Endpoint_Strategy_T.h.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
T_StreamEndpoint* TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::stream_endpoint_b_servant_ [protected]
 

Definition at line 75 of file Endpoint_Strategy_T.h.

template<class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
T_VDev* TAO_AV_Endpoint_Reactive_Strategy< T_StreamEndpoint, T_VDev, T_MediaCtrl >::vdev_servant_ [protected]
 

Definition at line 77 of file Endpoint_Strategy_T.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:47:03 2006 for TAO_AV by doxygen 1.3.6