TAO_Basic_StreamCtrl Class Reference

Base class for StreamCtrl, implements basic stream start and stop functionality. More...

#include <AVStreams_i.h>

Inheritance diagram for TAO_Basic_StreamCtrl:

Inheritance graph
[legend]
Collaboration diagram for TAO_Basic_StreamCtrl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Basic_StreamCtrl (void)
 Default Constructor.

virtual void stop (const AVStreams::flowSpec &the_spec)
virtual void start (const AVStreams::flowSpec &the_spec)
virtual void destroy (const AVStreams::flowSpec &the_spec)
virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos, const AVStreams::flowSpec &the_spec)
virtual void push_event (const struct CosPropertyService::Property &the_event)
virtual void set_FPStatus (const AVStreams::flowSpec &the_spec, const char *fp_name, const CORBA::Any &fp_settings)
 Used to control the flow protocol parameters.

virtual CORBA::Object_ptr get_flow_connection (const char *flow_name)
virtual void set_flow_connection (const char *flow_name, CORBA::Object_ptr flow_connection)

Protected Types

typedef ACE_Hash_Map_Manager<
ACE_CString, AVStreams::FlowConnection_var,
ACE_Null_Mutex
FlowConnection_Map
 Hash table for the flow names and its corresponding flowconnection object reference.

typedef ACE_Hash_Map_Iterator<
ACE_CString, AVStreams::FlowConnection_var,
ACE_Null_Mutex
FlowConnection_Map_Iterator
typedef ACE_Hash_Map_Entry<
ACE_CString, AVStreams::FlowConnection_var > 
FlowConnection_Map_Entry

Protected Member Functions

virtual ~TAO_Basic_StreamCtrl (void)
 Destructor.


Protected Attributes

AVStreams::VDev_var vdev_a_
 The Virtual Devices for this stream.

AVStreams::VDev_var vdev_b_
AVStreams::StreamEndPoint_A_var sep_a_
 The Endpoints for this stream.

AVStreams::StreamEndPoint_B_var sep_b_
FlowConnection_Map flow_connection_map_
AVStreams::FlowConnection_seq flowConnections_
u_int flow_count_
 sequence of flow names.

AVStreams::flowSpec flows_

Detailed Description

Base class for StreamCtrl, implements basic stream start and stop functionality.

Definition at line 75 of file AVStreams_i.h.


Member Typedef Documentation

typedef ACE_Hash_Map_Manager<ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> TAO_Basic_StreamCtrl::FlowConnection_Map [protected]
 

Hash table for the flow names and its corresponding flowconnection object reference.

Definition at line 137 of file AVStreams_i.h.

typedef ACE_Hash_Map_Entry<ACE_CString,AVStreams::FlowConnection_var> TAO_Basic_StreamCtrl::FlowConnection_Map_Entry [protected]
 

Definition at line 139 of file AVStreams_i.h.

Referenced by destroy(), start(), and stop().

typedef ACE_Hash_Map_Iterator<ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> TAO_Basic_StreamCtrl::FlowConnection_Map_Iterator [protected]
 

Definition at line 138 of file AVStreams_i.h.

Referenced by destroy(), start(), and stop().


Constructor & Destructor Documentation

TAO_Basic_StreamCtrl::TAO_Basic_StreamCtrl void   ) 
 

Default Constructor.

Definition at line 70 of file AVStreams_i.cpp.

00071   :flow_count_ (0)
00072 {
00073 }

TAO_Basic_StreamCtrl::~TAO_Basic_StreamCtrl void   )  [protected, virtual]
 

Destructor.

Definition at line 280 of file AVStreams_i.cpp.

00281 {
00282 }


Member Function Documentation

void TAO_Basic_StreamCtrl::destroy const AVStreams::flowSpec the_spec  )  [virtual]
 

Tears down the stream. This will close the connection, and delete the streamendpoint and vdev associated with this stream Empty the_spec means apply operation to all flows

Reimplemented in TAO_StreamCtrl.

Definition at line 166 of file AVStreams_i.cpp.

References ACE_CString, ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::advance(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::current_size(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), flow_connection_map_, FlowConnection_Map_Entry, FlowConnection_Map_Iterator, AVStreams::flowSpec, TAO_AV_Core::get_flowname(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().

Referenced by TAO_StreamCtrl::destroy().

00167 {
00168   try
00169     {
00170       // call stop on the flow connections.
00171       if (this->flow_connection_map_.current_size () > 0)
00172         {
00173           if (flow_spec.length () > 0)
00174           {
00175             for (u_int i=0;i<flow_spec.length ();i++)
00176               {
00177                 char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]);
00178                 ACE_CString flow_name_key (flowname);
00179                 FlowConnection_Map::ENTRY *flow_connection_entry = 0;
00180                 if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0)
00181                   {
00182                     flow_connection_entry->int_id_->destroy ();
00183                   }
00184               }
00185           }
00186           else
00187             {
00188               // call destroy on all the flows.
00189               FlowConnection_Map_Iterator iterator (this->flow_connection_map_);
00190               FlowConnection_Map_Entry *entry = 0;
00191               for (;iterator.next (entry) !=  0;iterator.advance ())
00192                 {
00193                   entry->int_id_->destroy ();
00194                 }
00195             }
00196         }
00197     }
00198   catch (const CORBA::Exception& ex)
00199     {
00200       ex._tao_print_exception ("TAO_Basic_StreamCtrl::destroy");
00201       return;
00202     }
00203 }

CORBA::Object_ptr TAO_Basic_StreamCtrl::get_flow_connection const char *  flow_name  )  [virtual]
 

Not implemented in the light profile, will raise the notsupported exception

Definition at line 239 of file AVStreams_i.cpp.

References ACE_CString, ACE_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), flow_connection_map_, LM_DEBUG, and TAO_debug_level.

Referenced by TAO_StreamCtrl::bind().

00240 {
00241   ACE_CString flow_name_key (flow_name);
00242   AVStreams::FlowConnection_var flow_connection_entry;
00243 
00244   if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0){
00245     return flow_connection_entry._retn();
00246   }
00247   else{
00248     if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) Cannot find flow: %s\n", flow_name ));
00249     throw AVStreams::noSuchFlow ();
00250   }
00251 }

CORBA::Boolean TAO_Basic_StreamCtrl::modify_QoS AVStreams::streamQoS new_qos,
const AVStreams::flowSpec the_spec
[virtual]
 

Changes the QoS associated with the stream Empty the_spec means apply operation to all flows

Reimplemented in TAO_StreamCtrl.

Definition at line 209 of file AVStreams_i.cpp.

References AVStreams::flowSpec, and AVStreams::streamQoS.

00211 {
00212   return 1;
00213 }

void TAO_Basic_StreamCtrl::push_event const struct CosPropertyService::Property &  the_event  )  [virtual]
 

Used by StreamEndPoint and VDev to inform StreamCtrl of events. E.g., loss of flow, reestablishment of flow, etc..

Definition at line 218 of file AVStreams_i.cpp.

References ACE_DEBUG, LM_DEBUG, and TAO_debug_level.

00219 {
00220   if (TAO_debug_level > 0)
00221     ACE_DEBUG ((LM_DEBUG, "\n(%P|%t) Recieved event \""));
00222 }

void TAO_Basic_StreamCtrl::set_flow_connection const char *  flow_name,
CORBA::Object_ptr  flow_connection
[virtual]
 

Not implemented in the light profile, will raise the notsupported exception

Definition at line 255 of file AVStreams_i.cpp.

References ACE_CString, ACE_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::bind(), flow_connection_map_, flow_count_, flows_, LM_DEBUG, CORBA::string_dup(), and TAO_debug_level.

Referenced by TAO_StreamCtrl::bind().

00257 {
00258   AVStreams::FlowConnection_var flow_connection;
00259   try
00260     {
00261       flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj);
00262     }
00263   catch (const CORBA::Exception& ex)
00264     {
00265       ex._tao_print_exception (
00266         "TAO_Basic_StreamCtrl::set_flow_connection");
00267       return;
00268     }
00269   // add the flowname and the flowconnection to the hashtable.
00270   this->flows_.length (this->flow_count_ + 1);
00271   this->flows_ [this->flow_count_++] = CORBA::string_dup (flow_name);
00272   ACE_CString flow_name_key (flow_name);
00273   if (this->flow_connection_map_.bind (flow_name_key, flow_connection) != 0)
00274   {
00275     if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) Cannot find flow: %s\n", flow_name ));
00276     throw AVStreams::noSuchFlow ();// is this right?
00277   }
00278 }

void TAO_Basic_StreamCtrl::set_FPStatus const AVStreams::flowSpec the_spec,
const char *  fp_name,
const CORBA::Any &  fp_settings
[virtual]
 

Used to control the flow protocol parameters.

Definition at line 226 of file AVStreams_i.cpp.

References AVStreams::flowSpec, CORBA::is_nil(), and sep_a_.

00230 {
00231   if (!CORBA::is_nil (this->sep_a_.in ()))
00232     {
00233       this->sep_a_->set_FPStatus (flow_spec, fp_name, fp_settings);
00234     }
00235 }

void TAO_Basic_StreamCtrl::start const AVStreams::flowSpec the_spec  )  [virtual]
 

Start the transfer of data in the stream. Empty the_spec means apply operation to all flows

Reimplemented in TAO_StreamCtrl.

Definition at line 121 of file AVStreams_i.cpp.

References ACE_CString, ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::advance(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::current_size(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), flow_connection_map_, FlowConnection_Map_Entry, FlowConnection_Map_Iterator, AVStreams::flowSpec, TAO_AV_Core::get_flowname(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().

Referenced by TAO_StreamCtrl::start().

00122 {
00123   try
00124     {
00125       // @@Call start on the Related MediaCtrl.
00126 
00127       // call start on the flow connections.
00128       if (this->flow_connection_map_.current_size () > 0)
00129         {
00130           if (flow_spec.length () > 0)
00131             for (u_int i = 0; i < flow_spec.length (); i++)
00132               {
00133                 char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]);
00134                 ACE_CString flow_name_key (flowname);
00135                 FlowConnection_Map::ENTRY *flow_connection_entry = 0;
00136                 if (this->flow_connection_map_.find (flow_name_key,
00137                                                      flow_connection_entry) == 0)
00138                   {
00139                     flow_connection_entry->int_id_->start ();
00140                   }
00141               }
00142           else
00143             {
00144               // call start on all the flows.
00145               FlowConnection_Map_Iterator iterator (this->flow_connection_map_);
00146               FlowConnection_Map_Entry *entry = 0;
00147               for (;iterator.next (entry) !=  0;iterator.advance ())
00148                 {
00149                   entry->int_id_->start ();
00150                 }
00151             }
00152         }
00153     }
00154   catch (const CORBA::Exception& ex)
00155     {
00156       ex._tao_print_exception ("TAO_Basic_StreamCtrl::start");
00157       return;
00158     }
00159 }

void TAO_Basic_StreamCtrl::stop const AVStreams::flowSpec the_spec  )  [virtual]
 

Stop the transfer of data of the stream Empty the_spec means apply operation to all flows

Reimplemented in TAO_StreamCtrl.

Definition at line 79 of file AVStreams_i.cpp.

References ACE_CString, ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::advance(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::current_size(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), flow_connection_map_, FlowConnection_Map_Entry, FlowConnection_Map_Iterator, AVStreams::flowSpec, TAO_AV_Core::get_flowname(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().

Referenced by TAO_StreamCtrl::stop().

00080 {
00081   try
00082     {
00083       // @@Call stop on the Related MediaCtrl.  call stop on the flow
00084       // connections.
00085       if (this->flow_connection_map_.current_size () > 0)
00086         {
00087           if (flow_spec.length () > 0)
00088             for (u_int i=0;i<flow_spec.length ();i++)
00089               {
00090                 char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]);
00091                 ACE_CString flow_name_key (flowname);
00092                 AVStreams::FlowConnection_var flow_connection_entry;
00093                 if (this->flow_connection_map_.find (flow_name_key,
00094                                                      flow_connection_entry) == 0)
00095                   {
00096                     flow_connection_entry->stop ();
00097                   }
00098               }
00099           else
00100             {
00101               // call stop on all the flows.
00102               FlowConnection_Map_Iterator iterator (this->flow_connection_map_);
00103               FlowConnection_Map_Entry *entry;
00104               for (;iterator.next (entry) !=  0;iterator.advance ())
00105                 {
00106                   entry->int_id_->stop ();
00107                 }
00108             }
00109         }
00110     }
00111   catch (const CORBA::Exception& ex)
00112     {
00113       ex._tao_print_exception ("TAO_Basic_StreamCtrl::stop");
00114       return;
00115     }
00116 }


Member Data Documentation

FlowConnection_Map TAO_Basic_StreamCtrl::flow_connection_map_ [protected]
 

Definition at line 140 of file AVStreams_i.h.

Referenced by destroy(), get_flow_connection(), set_flow_connection(), start(), and stop().

u_int TAO_Basic_StreamCtrl::flow_count_ [protected]
 

sequence of flow names.

Definition at line 144 of file AVStreams_i.h.

Referenced by set_flow_connection().

AVStreams::FlowConnection_seq TAO_Basic_StreamCtrl::flowConnections_ [protected]
 

Definition at line 141 of file AVStreams_i.h.

AVStreams::flowSpec TAO_Basic_StreamCtrl::flows_ [protected]
 

Definition at line 145 of file AVStreams_i.h.

Referenced by set_flow_connection().

AVStreams::StreamEndPoint_A_var TAO_Basic_StreamCtrl::sep_a_ [protected]
 

The Endpoints for this stream.

Definition at line 133 of file AVStreams_i.h.

Referenced by set_FPStatus().

AVStreams::StreamEndPoint_B_var TAO_Basic_StreamCtrl::sep_b_ [protected]
 

Definition at line 134 of file AVStreams_i.h.

AVStreams::VDev_var TAO_Basic_StreamCtrl::vdev_a_ [protected]
 

The Virtual Devices for this stream.

Definition at line 129 of file AVStreams_i.h.

AVStreams::VDev_var TAO_Basic_StreamCtrl::vdev_b_ [protected]
 

Definition at line 130 of file AVStreams_i.h.


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 16:07:43 2008 for TAO_AV by doxygen 1.3.6