TAO_FlowProducer Class Reference

#include <AVStreams_i.h>

Inheritance diagram for TAO_FlowProducer:

Inheritance graph
[legend]
Collaboration diagram for TAO_FlowProducer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_FlowProducer (void)
 default constructor

 TAO_FlowProducer (const char *flowname, AVStreams::protocolSpec protocols, const char *format)
virtual char * get_rev_channel (const char *pcol_name)
virtual void stop (void)
 stop this flow, to be overridden by the application.

virtual void start (void)
 start this flow, to be overridden by the application.

virtual char * go_to_listen (AVStreams::QoS &the_qos, CORBA::Boolean is_mcast, AVStreams::FlowEndPoint_ptr peer, char *&flowProtocol)
virtual CORBA::Boolean connect_to_peer (AVStreams::QoS &the_qos, const char *address, const char *use_flow_protocol)
virtual char * connect_mcast (AVStreams::QoS &the_qos, CORBA::Boolean_out is_met, const char *address, const char *use_flow_protocol)
 connect to the multicast address, not implemented.

virtual void set_key (const AVStreams::key &the_key)
 sets the public key to be used for encryption of the data.

virtual void set_source_id (CORBA::Long source_id)

Protected Attributes

CORBA::Long source_id_
 source id of this producer.

CORBA::String_var peer_address_

Constructor & Destructor Documentation

TAO_FlowProducer::TAO_FlowProducer void   ) 
 

default constructor

Definition at line 4226 of file AVStreams_i.cpp.

04227 {
04228 }

TAO_FlowProducer::TAO_FlowProducer const char *  flowname,
AVStreams::protocolSpec  protocols,
const char *  format
 

Definition at line 4230 of file AVStreams_i.cpp.

References TAO_FlowEndPoint::open(), and AVStreams::protocolSpec.

04233 {
04234   this->open (flowname, protocols, format);
04235 }


Member Function Documentation

char * TAO_FlowProducer::connect_mcast AVStreams::QoS the_qos,
CORBA::Boolean_out  is_met,
const char *  address,
const char *  use_flow_protocol
[virtual]
 

connect to the multicast address, not implemented.

Definition at line 4301 of file AVStreams_i.cpp.

References ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, TAO_AV_Flow_Handler::event_handler(), TAO_FlowSpec_Entry::handler(), ACE_Unbounded_Set< T >::insert(), ACE_Singleton< TYPE, ACE_LOCK >::instance(), LM_DEBUG, LM_ERROR, TAO_AV_Acceptor_Registry::open(), ACE_Event_Handler::reactor(), CORBA::string_dup(), and TAO_debug_level.

04305 {
04306   // The address variable gives the multicast address to subscribe to.
04307   for (u_int i=0;i<this->protocols_.length ();i++)
04308     {
04309       // choose the protocol which supports multicast.
04310     }
04311 
04312   if (address == 0)
04313     if (TAO_debug_level > 0)
04314       ACE_DEBUG ((LM_DEBUG, "TAO_FlowProducer::connect_mcast address is 0\n"));
04315   TAO_Forward_FlowSpec_Entry  *entry;
04316   ACE_NEW_RETURN (entry,
04317                   TAO_Forward_FlowSpec_Entry(this->flowname_.in (),
04318                                              "IN",
04319                                              this->format_.in (),
04320                                              use_flow_protocol,
04321                                              address),
04322                   0);
04323 
04324   this->flow_spec_set_.insert (entry);
04325   TAO_AV_Acceptor_Registry *acceptor_registry =
04326     TAO_AV_CORE::instance ()->acceptor_registry ();
04327   int result = acceptor_registry->open (this,
04328                                         TAO_AV_CORE::instance (),
04329                                         this->flow_spec_set_);
04330   if (result < 0)
04331     ACE_ERROR_RETURN ((LM_ERROR, "TAO_FlowProducer::connect_mcast:acceptor_registry open failed\n"), 0);
04332   // Now remove our handler from the reactor since we're a producer and dont want to get called for
04333   // multicast packets.
04334   ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
04335   event_handler->reactor ()->remove_handler (event_handler,
04336                                              ACE_Event_Handler::READ_MASK);
04337   return CORBA::string_dup (address);
04338 }

CORBA::Boolean TAO_FlowProducer::connect_to_peer AVStreams::QoS the_qos,
const char *  address,
const char *  use_flow_protocol
[virtual]
 

This should be implemented in both the FlowProducer and consumer and hence is pure virtual since we need to know the role of the flowendpoint to create appropriate protocol objects. eg. in SFP to create Producer Object/ Consumer Object.

Implements TAO_FlowEndPoint.

Definition at line 4290 of file AVStreams_i.cpp.

References TAO_FlowEndPoint::connect_to_peer_i().

04293 {
04294   return this->connect_to_peer_i (TAO_FlowSpec_Entry::TAO_AV_PRODUCER,
04295                                   the_qos,
04296                                   address,
04297                                   use_flow_protocol);
04298 }

char * TAO_FlowProducer::get_rev_channel const char *  pcol_name  )  [virtual]
 

get the reverse channel, to be used for feedback for protocols like UDP. @Naga: In the spec this is defined in the TAO_FlowProducer but it seems more reasonable for this to be in a FlowEndPoint since any of the flowendpoints can be made to listen. So in the case of UDP if the producer is listening and the consumer connects (logically) then the producer needs to know the reverse channel on its peer fep to send data to.

Definition at line 4239 of file AVStreams_i.cpp.

04240 {
04241   return 0;
04242 }

char * TAO_FlowProducer::go_to_listen AVStreams::QoS the_qos,
CORBA::Boolean  is_mcast,
AVStreams::FlowEndPoint_ptr  peer,
char *&  flowProtocol
[virtual]
 

This should be implemented in both the FlowProducer and consumer and hence is pure virtual since we need to know the role of the flowendpoint to create appropriate protocol objects. eg. in SFP to create Producer Object/ Consumer Object.

Implements TAO_FlowEndPoint.

Definition at line 4277 of file AVStreams_i.cpp.

References TAO_FlowEndPoint::go_to_listen_i().

04281 {
04282   return this->go_to_listen_i (TAO_FlowSpec_Entry::TAO_AV_PRODUCER,
04283                                the_qos,
04284                                is_mcast,
04285                                peer_fep,
04286                                flowProtocol);
04287 }

void TAO_FlowProducer::set_key const AVStreams::key the_key  )  [virtual]
 

sets the public key to be used for encryption of the data.

Definition at line 4342 of file AVStreams_i.cpp.

References AVStreams::key.

04343 {
04344   try
04345     {
04346       CORBA::Any anyval;
04347       anyval <<= the_key;
04348       this->define_property ("PublicKey",
04349                              anyval);
04350     }
04351   catch (const CORBA::Exception& ex)
04352     {
04353       ex._tao_print_exception ("TAO_FlowProducer::set_key");
04354     }
04355 }

void TAO_FlowProducer::set_source_id CORBA::Long  source_id  )  [virtual]
 

sets the source id of this flow producer so that it can be used to distinguish this producer from others in the multicast case.

Definition at line 4359 of file AVStreams_i.cpp.

04360 {
04361   this->source_id_ = source_id;
04362 }

void TAO_FlowProducer::start void   )  [virtual]
 

start this flow, to be overridden by the application.

Definition at line 4258 of file AVStreams_i.cpp.

References ACE_Unbounded_Set< T >::begin(), TAO_FlowSpec_Entry::control_handler(), ACE_Unbounded_Set< T >::end(), TAO_FlowSpec_Entry::handler(), TAO_AV_Flow_Handler::start(), and TAO_AV_FlowSpecSetItor.

04259 {
04260   TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
04261   for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
04262        begin != end; ++begin)
04263     {
04264       TAO_FlowSpec_Entry *entry = (*begin);
04265       if (entry->handler () != 0)
04266         {
04267           entry->handler ()->start (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
04268         }
04269       if (entry->control_handler () != 0)
04270         {
04271           entry->control_handler ()->start (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
04272         }
04273     }
04274 }

void TAO_FlowProducer::stop void   )  [virtual]
 

stop this flow, to be overridden by the application.

Definition at line 4246 of file AVStreams_i.cpp.

References ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), TAO_FlowSpec_Entry::handler(), TAO_AV_Flow_Handler::stop(), and TAO_AV_FlowSpecSetItor.

04247 {
04248   TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
04249   for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
04250        begin != end; ++begin)
04251     {
04252       TAO_FlowSpec_Entry *entry = (*begin);
04253       entry->handler ()->stop (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
04254     }
04255 }


Member Data Documentation

CORBA::String_var TAO_FlowProducer::peer_address_ [protected]
 

Definition at line 1082 of file AVStreams_i.h.

CORBA::Long TAO_FlowProducer::source_id_ [protected]
 

source id of this producer.

Definition at line 1081 of file AVStreams_i.h.


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