Base class for StreamCtrl, implements basic stream start and stop functionality. More...
#include <AVStreams_i.h>
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_ |
Base class for StreamCtrl, implements basic stream start and stop functionality.
Definition at line 75 of file AVStreams_i.h.
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.
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.
TAO_Basic_StreamCtrl::TAO_Basic_StreamCtrl | ( | void | ) |
TAO_Basic_StreamCtrl::~TAO_Basic_StreamCtrl | ( | void | ) | [protected, virtual] |
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 182 of file AVStreams_i.cpp.
{ try { // call stop on the flow connections. if (this->flow_connection_map_.current_size () > 0) { if (flow_spec.length () > 0) { for (u_int i=0;i<flow_spec.length ();i++) { char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]); ACE_CString flow_name_key (flowname); FlowConnection_Map::ENTRY *flow_connection_entry = 0; if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0) { flow_connection_entry->int_id_->destroy (); } } } else { // call destroy on all the flows. FlowConnection_Map_Iterator iterator (this->flow_connection_map_); FlowConnection_Map_Entry *entry = 0; for (;iterator.next (entry) != 0;iterator.advance ()) { entry->int_id_->destroy (); } } } } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("TAO_Basic_StreamCtrl::destroy"); return; } }
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 255 of file AVStreams_i.cpp.
{ ACE_CString flow_name_key (flow_name); AVStreams::FlowConnection_var flow_connection_entry; if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0){ return flow_connection_entry._retn(); } else{ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) Cannot find flow: %s\n", flow_name )); throw AVStreams::noSuchFlow (); } }
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 225 of file AVStreams_i.cpp.
{
return 1;
}
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 234 of file AVStreams_i.cpp.
{ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "\n(%P|%t) Recieved event \"")); }
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 271 of file AVStreams_i.cpp.
{ AVStreams::FlowConnection_var flow_connection; try { flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj); } catch (const CORBA::Exception& ex) { ex._tao_print_exception ( "TAO_Basic_StreamCtrl::set_flow_connection"); return; } // add the flowname and the flowconnection to the hashtable. this->flows_.length (this->flow_count_ + 1); this->flows_ [this->flow_count_++] = CORBA::string_dup (flow_name); ACE_CString flow_name_key (flow_name); if (this->flow_connection_map_.bind (flow_name_key, flow_connection) != 0) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) Cannot find flow: %s\n", flow_name )); throw AVStreams::noSuchFlow ();// is this right? } }
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 242 of file AVStreams_i.cpp.
{ if (!CORBA::is_nil (this->sep_a_.in ())) { this->sep_a_->set_FPStatus (flow_spec, fp_name, fp_settings); } }
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 129 of file AVStreams_i.cpp.
{ try { // @@Call start on the Related MediaCtrl. // call start on the flow connections. if (this->flow_connection_map_.current_size () > 0) { if (flow_spec.length () > 0) for (u_int i = 0; i < flow_spec.length (); i++) { char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]); ACE_CString flow_name_key (flowname); FlowConnection_Map::ENTRY *flow_connection_entry = 0; if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0) { flow_connection_entry->int_id_->start (); } } else { // call start on all the flows. FlowConnection_Map_Iterator iterator (this->flow_connection_map_); FlowConnection_Map_Entry *entry = 0; for (;iterator.next (entry) != 0;iterator.advance ()) { entry->int_id_->start (); } } } } catch (const AVStreams::noSuchFlow&) { throw; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("TAO_Basic_StreamCtrl::start"); throw; } catch(...) { printf ("TAO_Basic_StreamCtrl::start - unknown exception\n"); } }
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.
{ try { // @@Call stop on the Related MediaCtrl. call stop on the flow // connections. if (this->flow_connection_map_.current_size () > 0) { if (flow_spec.length () > 0) for (u_int i=0;i<flow_spec.length ();i++) { char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]); ACE_CString flow_name_key (flowname); AVStreams::FlowConnection_var flow_connection_entry; if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0) { flow_connection_entry->stop (); } } else { // call stop on all the flows. FlowConnection_Map_Iterator iterator (this->flow_connection_map_); FlowConnection_Map_Entry *entry; for (;iterator.next (entry) != 0;iterator.advance ()) { entry->int_id_->stop (); } } } } catch (const AVStreams::noSuchFlow&) { throw; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("TAO_Basic_StreamCtrl::stop"); throw; } catch(...) { printf ("TAO_Basic_StreamCtrl::stop - unknown exception\n"); } }
Definition at line 140 of file AVStreams_i.h.
u_int TAO_Basic_StreamCtrl::flow_count_ [protected] |
sequence of flow names.
Definition at line 144 of file AVStreams_i.h.
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.
AVStreams::StreamEndPoint_A_var TAO_Basic_StreamCtrl::sep_a_ [protected] |
The Endpoints for this stream.
Definition at line 133 of file AVStreams_i.h.
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.