TAO_StreamEndPoint Class Reference

The Stream EndPoint. Used to implement one endpoint of a stream that implements the transport layer. More...

#include <AVStreams_i.h>

Inheritance diagram for TAO_StreamEndPoint:

Inheritance graph
[legend]
Collaboration diagram for TAO_StreamEndPoint:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_StreamEndPoint (void)
 Constructor.

virtual void stop (const AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow)
 Stop the stream. Empty the_spec means, for all the flows.

virtual void start (const AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow)
 Start the stream, Empty the_spec means, for all the flows.

virtual void destroy (const AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow)
 Destroy the stream, Empty the_spec means, for all the flows.

virtual CORBA::Boolean connect (AVStreams::StreamEndPoint_ptr responder, AVStreams::streamQoS &qos_spec, const AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::QoSRequestFailed, AVStreams::streamOpFailed)
 Called by StreamCtrl. responder is the peer to connect to.

virtual CORBA::Boolean request_connection (AVStreams::StreamEndPoint_ptr initiator, CORBA::Boolean is_mcast, AVStreams::streamQoS &qos, AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::streamOpDenied, AVStreams::noSuchFlow, AVStreams::QoSRequestFailed, AVStreams::FPError)
virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos, const AVStreams::flowSpec &the_flows ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::QoSRequestFailed)
 Change the transport qos on a stream.

virtual int change_qos (AVStreams::streamQoS &new_qos, const AVStreams::flowSpec &the_flows ACE_ENV_ARG_DECL_WITH_DEFAULTS)
virtual CORBA::Boolean set_protocol_restriction (const AVStreams::protocolSpec &the_pspec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Used to restrict the set of protocols.

virtual void disconnect (const AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::streamOpFailed)
 disconnect the flows

virtual void set_FPStatus (const AVStreams::flowSpec &the_spec, const char *fp_name, const CORBA::Any &fp_settings ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::FPError)
 Used to control the flow.

virtual CORBA::Object_ptr get_fep (const char *flow_name ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::noSuchFlow)
 Not implemented in the light profile, throws notsupported.

virtual char * add_fep (CORBA::Object_ptr the_fep ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed)
 Not implemented in the light profile, throws notsupported.

virtual void remove_fep (const char *fep_name ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed)
 Not implemented in the light profile, throws notsupported.

virtual void set_negotiator (AVStreams::Negotiator_ptr new_negotiator ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Used to "attach" a negotiator to the endpoint.

virtual void set_key (const char *flow_name, const AVStreams::key &the_key ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Used for public key encryption.

virtual void set_source_id (CORBA::Long source_id ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Used to set a unique id for packets sent by this streamendpoint.

virtual ~TAO_StreamEndPoint (void)
 Destructor.

CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos, AVStreams::flowSpec &the_spec ACE_ENV_ARG_DECL)

Protected Member Functions

char * add_fep_i (AVStreams::FlowEndPoint_ptr fep ACE_ENV_ARG_DECL) throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed)
 Helper methods to implement add_fep().

char * add_fep_i_add_property (AVStreams::FlowEndPoint_ptr fep ACE_ENV_ARG_DECL) throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed)
int translate_qos (const AVStreams::streamQoS &application_qos, AVStreams::streamQoS &network_qos)
 translate from application level to network level qos.


Protected Attributes

u_int flow_count_
u_int flow_num_
 current flow number used for system generation of flow names.

FlowEndPoint_Map fep_map_
 hash table for the flownames and its corresponding flowEndpoint reference.

AVStreams::flowSpec flows_
 sequence of supported flow names.

CORBA::Long source_id_
 source id used for multicast.

AVStreams::Negotiator_var negotiator_
 our local negotiator for QoS.

AVStreams::protocolSpec protocols_
 Our available list of protocols.

CORBA::String_var protocol_
 Chosen protocol for this streamendpoint based on availableprotocols property.

AVStreams::key key_
 Key used for encryption.

u_short mcast_port_
ACE_CString mcast_addr_
ACE_Hash_Map_Manager< ACE_CString,
TAO_FlowSpec_Entry *, ACE_Null_Mutex
mcast_entry_map_
TAO_AV_FlowSpecSet forward_flow_spec_set
TAO_AV_FlowSpecSet reverse_flow_spec_set
AVStreams::StreamEndPoint_var peer_sep_
AVStreams::SFPStatussfp_status_
AVStreams::StreamCtrl_var streamctrl_

Detailed Description

The Stream EndPoint. Used to implement one endpoint of a stream that implements the transport layer.

Definition at line 540 of file AVStreams_i.h.


Constructor & Destructor Documentation

TAO_StreamEndPoint::TAO_StreamEndPoint void   ) 
 

Constructor.

Definition at line 1784 of file AVStreams_i.cpp.

References ACE_DEBUG, ACE_DEFAULT_MULTICAST_ADDR, ACE_DEFAULT_MULTICAST_PORT, LM_DEBUG, mcast_addr_, and TAO_debug_level.

01785   :flow_count_ (0),
01786    flow_num_ (0),
01787    mcast_port_ (ACE_DEFAULT_MULTICAST_PORT+1)
01788 {
01789   //is->mcast_addr_ = ACE_OS::inet_addr (ACE_DEFAULT_MULTICAST_ADDR);
01790   this->mcast_addr_.set (ACE_DEFAULT_MULTICAST_ADDR);
01791   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::TAO_StreamEndPoint::mcast_addr = %s", this->mcast_addr_.c_str ()));
01792   //  this->handle_open ();
01793 }

TAO_StreamEndPoint::~TAO_StreamEndPoint void   )  [virtual]
 

Destructor.

Definition at line 2717 of file AVStreams_i.cpp.

References ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), forward_flow_spec_set, reverse_flow_spec_set, and TAO_AV_FlowSpecSetItor.

02718 {
02719   //this->handle_close ();
02720   TAO_AV_FlowSpecSetItor begin = this->forward_flow_spec_set.begin ();
02721   TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
02722 
02723   int i=0;
02724   // @@ Naga: Will the iterator always give the entries in the order of insertion.
02725   // or is it an implementation fact of ACE containers.
02726   for ( ; begin != end; ++begin, ++i)
02727     {
02728 //       if (i >= FLOWSPEC_MAX)
02729 //         {
02730           TAO_FlowSpec_Entry *entry = *begin;
02731           delete entry;
02732           //        }
02733     }
02734   begin = this->reverse_flow_spec_set.begin ();
02735   end = this->reverse_flow_spec_set.end ();
02736   i = 0;
02737   for (; begin != end; ++begin)
02738     {
02739 //       if (i >= FLOWSPEC_MAX)
02740 //         {
02741           TAO_FlowSpec_Entry *entry = *begin;
02742           delete entry;
02743           //        }
02744     }
02745 }


Member Function Documentation

virtual char* TAO_StreamEndPoint::add_fep CORBA::Object_ptr the_fep  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed) [virtual]
 

Not implemented in the light profile, throws notsupported.

char * TAO_StreamEndPoint::add_fep_i AVStreams::FlowEndPoint_ptr fep  ACE_ENV_ARG_DECL  )  throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed) [protected]
 

Helper methods to implement add_fep().

Definition at line 2535 of file AVStreams_i.cpp.

References ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, and CORBA::string_dup().

02540 {
02541   CORBA::String_var flow_name;
02542   ACE_TRY
02543     {
02544       CORBA::Any_var flow_name_any =
02545         fep->get_property_value ("FlowName" ACE_ENV_ARG_PARAMETER);
02546       ACE_TRY_CHECK;
02547 
02548       const char *tmp;
02549       flow_name_any >>= tmp;
02550       flow_name = CORBA::string_dup (tmp);
02551     }
02552   ACE_CATCHANY
02553     {
02554       flow_name =
02555         this->add_fep_i_add_property (fep ACE_ENV_ARG_PARAMETER);
02556       ACE_CHECK_RETURN (0);
02557     }
02558   ACE_ENDTRY;
02559   return flow_name._retn ();
02560 }

char * TAO_StreamEndPoint::add_fep_i_add_property AVStreams::FlowEndPoint_ptr fep  ACE_ENV_ARG_DECL  )  throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed) [protected]
 

Definition at line 2500 of file AVStreams_i.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CString, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, ACE_OS::sprintf(), and ACE_OS::strdup().

02505 {
02506   ACE_CString flow_name;
02507 
02508   ACE_TRY
02509     {
02510       // exception implies the flow name is not defined and is system
02511       // generated.
02512       flow_name = "flow";
02513       char tmp[255];
02514       ACE_OS::sprintf (tmp, "%u", this->flow_num_++);
02515       flow_name += tmp;
02516 
02517       CORBA::Any flowname_any;
02518       flowname_any <<= flow_name.c_str ();
02519       fep->define_property ("Flow",
02520                             flowname_any
02521                             ACE_ENV_ARG_PARAMETER);
02522       ACE_TRY_CHECK;
02523     }
02524   ACE_CATCHANY
02525     {
02526       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
02527                            "TAO_StreamEndPoint::add_fep");
02528       return 0;
02529     }
02530   ACE_ENDTRY;
02531   return ACE_OS::strdup( flow_name.c_str () );
02532 }

virtual int TAO_StreamEndPoint::change_qos AVStreams::streamQoS new_qos,
const AVStreams::flowSpec &the_flows  ACE_ENV_ARG_DECL_WITH_DEFAULTS
[virtual]
 

virtual CORBA::Boolean TAO_StreamEndPoint::connect AVStreams::StreamEndPoint_ptr  responder,
AVStreams::streamQoS qos_spec,
const AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL_WITH_DEFAULTS
throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::QoSRequestFailed, AVStreams::streamOpFailed) [virtual]
 

Called by StreamCtrl. responder is the peer to connect to.

virtual void TAO_StreamEndPoint::destroy const AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::noSuchFlow) [virtual]
 

Destroy the stream, Empty the_spec means, for all the flows.

virtual void TAO_StreamEndPoint::disconnect const AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::streamOpFailed) [virtual]
 

disconnect the flows

virtual CORBA::Object_ptr TAO_StreamEndPoint::get_fep const char *flow_name  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::noSuchFlow) [virtual]
 

Not implemented in the light profile, throws notsupported.

virtual CORBA::Boolean TAO_StreamEndPoint::modify_QoS AVStreams::streamQoS new_qos,
const AVStreams::flowSpec &the_flows  ACE_ENV_ARG_DECL_WITH_DEFAULTS
throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::QoSRequestFailed) [virtual]
 

Change the transport qos on a stream.

CORBA::Boolean TAO_StreamEndPoint::multiconnect AVStreams::streamQoS the_qos,
AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL
 

Reimplemented in TAO_StreamEndPoint_A, and TAO_StreamEndPoint_B.

virtual void TAO_StreamEndPoint::remove_fep const char *fep_name  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::notSupported, AVStreams::streamOpFailed) [virtual]
 

Not implemented in the light profile, throws notsupported.

virtual CORBA::Boolean TAO_StreamEndPoint::request_connection AVStreams::StreamEndPoint_ptr  initiator,
CORBA::Boolean  is_mcast,
AVStreams::streamQoS qos,
AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL_WITH_DEFAULTS
throw (CORBA::SystemException, AVStreams::streamOpDenied, AVStreams::noSuchFlow, AVStreams::QoSRequestFailed, AVStreams::FPError) [virtual]
 

Called by the peer StreamEndPoint. The flow_spec indicates the flows (which contain transport addresses etc.)

virtual void TAO_StreamEndPoint::set_FPStatus const AVStreams::flowSpec the_spec,
const char *  fp_name,
const CORBA::Any &fp_settings  ACE_ENV_ARG_DECL_WITH_DEFAULTS
throw (CORBA::SystemException, AVStreams::noSuchFlow, AVStreams::FPError) [virtual]
 

Used to control the flow.

virtual void TAO_StreamEndPoint::set_key const char *  flow_name,
const AVStreams::key &the_key  ACE_ENV_ARG_DECL_WITH_DEFAULTS
throw (CORBA::SystemException) [virtual]
 

Used for public key encryption.

void TAO_StreamEndPoint::set_negotiator AVStreams::Negotiator_ptr new_negotiator  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException) [virtual]
 

Used to "attach" a negotiator to the endpoint.

Definition at line 2648 of file AVStreams_i.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, and ACE_TRY_CHECK.

02651 {
02652   ACE_TRY
02653     {
02654       CORBA::Any negotiator;
02655       negotiator <<= new_negotiator;
02656       this->define_property ("Negotiator",
02657                              negotiator
02658                              ACE_ENV_ARG_PARAMETER);
02659       ACE_TRY_CHECK;
02660       this->negotiator_ = AVStreams::Negotiator::_duplicate (new_negotiator);
02661     }
02662   ACE_CATCHANY
02663     {
02664       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::set_negotiator");
02665     }
02666   ACE_ENDTRY;
02667   ACE_CHECK;
02668 }

virtual CORBA::Boolean TAO_StreamEndPoint::set_protocol_restriction const AVStreams::protocolSpec &the_pspec  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException) [virtual]
 

Used to restrict the set of protocols.

void TAO_StreamEndPoint::set_source_id CORBA::Long source_id  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException) [virtual]
 

Used to set a unique id for packets sent by this streamendpoint.

Definition at line 2700 of file AVStreams_i.cpp.

02703 {
02704   this->source_id_ = source_id;
02705 }

virtual void TAO_StreamEndPoint::start const AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::noSuchFlow) [virtual]
 

Start the stream, Empty the_spec means, for all the flows.

virtual void TAO_StreamEndPoint::stop const AVStreams::flowSpec &the_spec  ACE_ENV_ARG_DECL_WITH_DEFAULTS  )  throw (CORBA::SystemException, AVStreams::noSuchFlow) [virtual]
 

Stop the stream. Empty the_spec means, for all the flows.

int TAO_StreamEndPoint::translate_qos const AVStreams::streamQoS application_qos,
AVStreams::streamQoS network_qos
[protected]
 

translate from application level to network level qos.

Definition at line 1983 of file AVStreams_i.cpp.

References AVStreams::streamQoS.

01985 {
01986   u_int len = application_qos.length ();
01987   network_qos.length (len);
01988   for (u_int i=0;i<len;i++)
01989     {
01990       network_qos [i].QoSType = application_qos [i].QoSType;
01991       network_qos [i].QoSParams = application_qos [i].QoSParams;
01992     }
01993   return 0;
01994 }


Member Data Documentation

FlowEndPoint_Map TAO_StreamEndPoint::fep_map_ [protected]
 

hash table for the flownames and its corresponding flowEndpoint reference.

Definition at line 692 of file AVStreams_i.h.

u_int TAO_StreamEndPoint::flow_count_ [protected]
 

Count of the number of flows in this streamendpoint, used to generate unique names for the flows.

Definition at line 686 of file AVStreams_i.h.

u_int TAO_StreamEndPoint::flow_num_ [protected]
 

current flow number used for system generation of flow names.

Definition at line 689 of file AVStreams_i.h.

AVStreams::flowSpec TAO_StreamEndPoint::flows_ [protected]
 

sequence of supported flow names.

Definition at line 695 of file AVStreams_i.h.

TAO_AV_FlowSpecSet TAO_StreamEndPoint::forward_flow_spec_set [protected]
 

Definition at line 717 of file AVStreams_i.h.

Referenced by ~TAO_StreamEndPoint().

AVStreams::key TAO_StreamEndPoint::key_ [protected]
 

Key used for encryption.

Definition at line 710 of file AVStreams_i.h.

ACE_CString TAO_StreamEndPoint::mcast_addr_ [protected]
 

Definition at line 715 of file AVStreams_i.h.

Referenced by TAO_StreamEndPoint().

ACE_Hash_Map_Manager<ACE_CString, TAO_FlowSpec_Entry*,ACE_Null_Mutex> TAO_StreamEndPoint::mcast_entry_map_ [protected]
 

Definition at line 716 of file AVStreams_i.h.

u_short TAO_StreamEndPoint::mcast_port_ [protected]
 

TAO_Forward_FlowSpec_Entry forward_entries_ [FLOWSPEC_MAX]; TAO_Reverse_FlowSpec_Entry reverse_entries_ [FLOWSPEC_MAX];

Definition at line 714 of file AVStreams_i.h.

AVStreams::Negotiator_var TAO_StreamEndPoint::negotiator_ [protected]
 

our local negotiator for QoS.

Definition at line 701 of file AVStreams_i.h.

AVStreams::StreamEndPoint_var TAO_StreamEndPoint::peer_sep_ [protected]
 

Definition at line 719 of file AVStreams_i.h.

CORBA::String_var TAO_StreamEndPoint::protocol_ [protected]
 

Chosen protocol for this streamendpoint based on availableprotocols property.

Definition at line 707 of file AVStreams_i.h.

AVStreams::protocolSpec TAO_StreamEndPoint::protocols_ [protected]
 

Our available list of protocols.

Definition at line 704 of file AVStreams_i.h.

TAO_AV_FlowSpecSet TAO_StreamEndPoint::reverse_flow_spec_set [protected]
 

Definition at line 718 of file AVStreams_i.h.

Referenced by ~TAO_StreamEndPoint().

AVStreams::SFPStatus* TAO_StreamEndPoint::sfp_status_ [protected]
 

Definition at line 720 of file AVStreams_i.h.

CORBA::Long TAO_StreamEndPoint::source_id_ [protected]
 

source id used for multicast.

Definition at line 698 of file AVStreams_i.h.

AVStreams::StreamCtrl_var TAO_StreamEndPoint::streamctrl_ [protected]
 

Definition at line 721 of file AVStreams_i.h.


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