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_

Detailed Description

Definition at line 1028 of file AVStreams_i.h.


Constructor & Destructor Documentation

TAO_FlowProducer::TAO_FlowProducer ( void   ) 

default constructor

Definition at line 4274 of file AVStreams_i.cpp.

04275 {
04276 }

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

Definition at line 4278 of file AVStreams_i.cpp.

References TAO_FlowEndPoint::open().

04281 {
04282   this->open (flowname, protocols, format);
04283 }


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 4349 of file AVStreams_i.cpp.

References ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, TAO_AV_Flow_Handler::event_handler(), TAO_FlowEndPoint::flow_spec_set_, TAO_FlowEndPoint::format_, TAO_FlowSpec_Entry::handler(), ACE_Unbounded_Set_Ex< T, C >::insert(), ACE_Singleton< TYPE, ACE_LOCK >::instance(), LM_DEBUG, LM_ERROR, TAO_AV_Acceptor_Registry::open(), TAO_FlowEndPoint::protocols_, ACE_Event_Handler::reactor(), ACE_Event_Handler::READ_MASK, CORBA::string_dup(), and TAO_debug_level.

04353 {
04354   // The address variable gives the multicast address to subscribe to.
04355   for (u_int i=0;i<this->protocols_.length ();i++)
04356     {
04357       // choose the protocol which supports multicast.
04358     }
04359 
04360   if (address == 0)
04361     if (TAO_debug_level > 0)
04362       ACE_DEBUG ((LM_DEBUG, "TAO_FlowProducer::connect_mcast address is 0\n"));
04363   TAO_Forward_FlowSpec_Entry  *entry;
04364   ACE_NEW_RETURN (entry,
04365                   TAO_Forward_FlowSpec_Entry(this->flowname_.in (),
04366                                              "IN",
04367                                              this->format_.in (),
04368                                              use_flow_protocol,
04369                                              address),
04370                   0);
04371 
04372   this->flow_spec_set_.insert (entry);
04373   TAO_AV_Acceptor_Registry *acceptor_registry =
04374     TAO_AV_CORE::instance ()->acceptor_registry ();
04375   int result = acceptor_registry->open (this,
04376                                         TAO_AV_CORE::instance (),
04377                                         this->flow_spec_set_);
04378   if (result < 0)
04379     ACE_ERROR_RETURN ((LM_ERROR, "TAO_FlowProducer::connect_mcast:acceptor_registry open failed\n"), 0);
04380   // Now remove our handler from the reactor since we're a producer and dont want to get called for
04381   // multicast packets.
04382   ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
04383   event_handler->reactor ()->remove_handler (event_handler,
04384                                              ACE_Event_Handler::READ_MASK);
04385   return CORBA::string_dup (address);
04386 }

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 4338 of file AVStreams_i.cpp.

References TAO_FlowEndPoint::connect_to_peer_i(), and TAO_FlowSpec_Entry::TAO_AV_PRODUCER.

04341 {
04342   return this->connect_to_peer_i (TAO_FlowSpec_Entry::TAO_AV_PRODUCER,
04343                                   the_qos,
04344                                   address,
04345                                   use_flow_protocol);
04346 }

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 4287 of file AVStreams_i.cpp.

04288 {
04289   return 0;
04290 }

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 4325 of file AVStreams_i.cpp.

References TAO_FlowEndPoint::go_to_listen_i(), and TAO_FlowSpec_Entry::TAO_AV_PRODUCER.

04329 {
04330   return this->go_to_listen_i (TAO_FlowSpec_Entry::TAO_AV_PRODUCER,
04331                                the_qos,
04332                                is_mcast,
04333                                peer_fep,
04334                                flowProtocol);
04335 }

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 4390 of file AVStreams_i.cpp.

References CORBA::Exception::_tao_print_exception().

04391 {
04392   try
04393     {
04394       CORBA::Any anyval;
04395       anyval <<= the_key;
04396       this->define_property ("PublicKey",
04397                              anyval);
04398     }
04399   catch (const CORBA::Exception& ex)
04400     {
04401       ex._tao_print_exception ("TAO_FlowProducer::set_key");
04402     }
04403 }

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 4407 of file AVStreams_i.cpp.

References source_id_.

04408 {
04409   this->source_id_ = source_id;
04410 }

void TAO_FlowProducer::start ( void   )  [virtual]

start this flow, to be overridden by the application.

Definition at line 4306 of file AVStreams_i.cpp.

References ACE_Unbounded_Set_Ex< T, C >::end(), TAO_FlowEndPoint::flow_spec_set_, and TAO_FlowSpec_Entry::TAO_AV_PRODUCER.

04307 {
04308   TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
04309   for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
04310        begin != end; ++begin)
04311     {
04312       TAO_FlowSpec_Entry *entry = (*begin);
04313       if (entry->handler () != 0)
04314         {
04315           entry->handler ()->start (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
04316         }
04317       if (entry->control_handler () != 0)
04318         {
04319           entry->control_handler ()->start (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
04320         }
04321     }
04322 }

void TAO_FlowProducer::stop ( void   )  [virtual]

stop this flow, to be overridden by the application.

Definition at line 4294 of file AVStreams_i.cpp.

References ACE_Unbounded_Set_Ex< T, C >::end(), TAO_FlowEndPoint::flow_spec_set_, and TAO_FlowSpec_Entry::TAO_AV_PRODUCER.

04295 {
04296   TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
04297   for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
04298        begin != end; ++begin)
04299     {
04300       TAO_FlowSpec_Entry *entry = (*begin);
04301       entry->handler ()->stop (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
04302     }
04303 }


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.

Referenced by set_source_id().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:48:09 2010 for TAO_AV by  doxygen 1.4.7