TAO_FDev< T_Producer, T_Consumer > Class Template Reference

Implementation of the AV/Streams Flow Device. A FlowConnection is used to bind FDevs for flows, much like how a StreamCtrl is used to bind MMDevices for streams. More...

#include <Flows_T.h>

Collaboration diagram for TAO_FDev< T_Producer, T_Consumer >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_FDev (void)
 default constructor
 TAO_FDev (const char *flowname)
 constructor taking a flowname.
 ~TAO_FDev (void)
 Destructor..
const char * flowname (void)
void flowname (const char *flowname)
AVStreams::FlowProducer_ptr create_producer (AVStreams::FlowConnection_ptr the_requester, AVStreams::QoS &the_qos, CORBA::Boolean_out met_qos, char *&named_fdev)
virtual AVStreams::FlowProducer_ptr make_producer (AVStreams::FlowConnection_ptr the_requester, AVStreams::QoS &the_qos, CORBA::Boolean_out met_qos, char *&named_fdev)
virtual AVStreams::FlowConsumer_ptr create_consumer (AVStreams::FlowConnection_ptr the_requester, AVStreams::QoS &the_qos, CORBA::Boolean_out met_qos, char *&named_fdev)
 create a flow consumer object.
virtual AVStreams::FlowConsumer_ptr make_consumer (AVStreams::FlowConnection_ptr the_requester, AVStreams::QoS &the_qos, CORBA::Boolean_out met_qos, char *&named_fdev)
virtual AVStreams::FlowConnection_ptr bind (AVStreams::FDev_ptr peer_device, AVStreams::QoS &the_qos, CORBA::Boolean_out is_met)
 bind this FDev with another FDev.
virtual AVStreams::FlowConnection_ptr bind_mcast (AVStreams::FDev_ptr first_peer, AVStreams::QoS &the_qos, CORBA::Boolean_out is_met)
 multicast bind is not implemented yet.
virtual void destroy (AVStreams::FlowEndPoint_ptr the_ep, const char *fdev_name)
 destroys this FDev.

Protected Types

typedef ACE_DLList_Iterator<
TAO_FlowProducer
PRODUCER_LIST_ITERATOR
typedef ACE_DLList_Iterator<
TAO_FlowConsumer
CONSUMER_LIST_ITERATOR

Protected Attributes

ACE_DLList< TAO_FlowProducerproducer_list_
ACE_DLList< TAO_FlowConsumerconsumer_list_
CORBA::String_var flowname_

Detailed Description

template<class T_Producer, class T_Consumer>
class TAO_FDev< T_Producer, T_Consumer >

Implementation of the AV/Streams Flow Device. A FlowConnection is used to bind FDevs for flows, much like how a StreamCtrl is used to bind MMDevices for streams.

Definition at line 29 of file Flows_T.h.


Member Typedef Documentation

template<class T_Producer, class T_Consumer>
typedef ACE_DLList_Iterator<TAO_FlowConsumer> TAO_FDev< T_Producer, T_Consumer >::CONSUMER_LIST_ITERATOR [protected]

Definition at line 90 of file Flows_T.h.

template<class T_Producer, class T_Consumer>
typedef ACE_DLList_Iterator<TAO_FlowProducer> TAO_FDev< T_Producer, T_Consumer >::PRODUCER_LIST_ITERATOR [protected]

Definition at line 88 of file Flows_T.h.


Constructor & Destructor Documentation

template<class T_Producer, class T_Consumer>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_FDev< T_Producer, T_Consumer >::TAO_FDev ( void   ) 

default constructor

Definition at line 17 of file Flows_T.cpp.

00018 {
00019 }

template<class T_Producer, class T_Consumer>
TAO_FDev< T_Producer, T_Consumer >::TAO_FDev ( const char *  flowname  ) 

constructor taking a flowname.

Definition at line 22 of file Flows_T.cpp.

References CORBA::Exception::_tao_print_exception().

00023   :flowname_ (flowname)
00024 {
00025   try
00026     {
00027       CORBA::Any flowname_any;
00028       flowname_any <<= flowname;
00029       this->define_property ("Flow",
00030                              flowname_any);
00031     }
00032   catch (const CORBA::Exception& ex)
00033     {
00034       ex._tao_print_exception ("TAO_FDev::TAO_FDev");
00035     }
00036 }

template<class T_Producer, class T_Consumer>
TAO_FDev< T_Producer, T_Consumer >::~TAO_FDev ( void   ) 

Destructor..

Definition at line 39 of file Flows_T.cpp.

00040 {
00041   //no-op
00042 }


Member Function Documentation

template<class T_Producer, class T_Consumer>
AVStreams::FlowConnection_ptr TAO_FDev< T_Producer, T_Consumer >::bind ( AVStreams::FDev_ptr  peer_device,
AVStreams::QoS the_qos,
CORBA::Boolean_out  is_met 
) [virtual]

bind this FDev with another FDev.

Definition at line 150 of file Flows_T.cpp.

00153 {
00154   ACE_UNUSED_ARG (peer_device);
00155   ACE_UNUSED_ARG (the_qos);
00156   ACE_UNUSED_ARG (is_met);
00157   return 0;
00158 }

template<class T_Producer, class T_Consumer>
AVStreams::FlowConnection_ptr TAO_FDev< T_Producer, T_Consumer >::bind_mcast ( AVStreams::FDev_ptr  first_peer,
AVStreams::QoS the_qos,
CORBA::Boolean_out  is_met 
) [virtual]

multicast bind is not implemented yet.

Definition at line 163 of file Flows_T.cpp.

00166 {
00167   ACE_UNUSED_ARG (first_peer);
00168   ACE_UNUSED_ARG (the_qos);
00169   ACE_UNUSED_ARG (is_met);
00170   return 0;
00171 }

template<class T_Producer, class T_Consumer>
AVStreams::FlowConsumer_ptr TAO_FDev< T_Producer, T_Consumer >::create_consumer ( AVStreams::FlowConnection_ptr  the_requester,
AVStreams::QoS the_qos,
CORBA::Boolean_out  met_qos,
char *&  named_fdev 
) [virtual]

create a flow consumer object.

Definition at line 136 of file Flows_T.cpp.

References TAO_FDev< T_Producer, T_Consumer >::make_consumer().

00140 {
00141   return this->make_consumer (the_requester,
00142                               the_qos,
00143                               met_qos,
00144                               named_fdev);
00145 }

template<class T_Producer, class T_Consumer>
AVStreams::FlowProducer_ptr TAO_FDev< T_Producer, T_Consumer >::create_producer ( AVStreams::FlowConnection_ptr  the_requester,
AVStreams::QoS the_qos,
CORBA::Boolean_out  met_qos,
char *&  named_fdev 
)

Definition at line 71 of file Flows_T.cpp.

References TAO_FDev< T_Producer, T_Consumer >::make_producer().

00075 {
00076   // call the bridge method.
00077   return this->make_producer (the_requester,
00078                               the_qos,
00079                               met_qos,
00080                               named_fdev);
00081 }

template<class T_Producer, class T_Consumer>
void TAO_FDev< T_Producer, T_Consumer >::destroy ( AVStreams::FlowEndPoint_ptr  the_ep,
const char *  fdev_name 
) [virtual]

destroys this FDev.

Definition at line 175 of file Flows_T.cpp.

References ACE_DEBUG, ACE_DLList_Iterator< T >::advance(), TAO_AV_Core::deactivate_servant(), LM_DEBUG, ACE_DLList_Iterator< T >::next(), and TAO_debug_level.

00177 {
00178   // @@ Shouldn't the parameters be made use of!
00179   // Destroy/delete all the producers and consumers.
00180 
00181   TAO_FlowProducer *producer_i;
00182 
00183   for (PRODUCER_LIST_ITERATOR producer_list_iterator (this->producer_list_);
00184        (producer_i = producer_list_iterator.next ()) != 0;
00185        producer_list_iterator.advance ())
00186     {
00187       TAO_AV_Core::deactivate_servant (producer_i);
00188       delete producer_i;
00189     }
00190 
00191   TAO_FlowConsumer *consumer_i;
00192 
00193   for (CONSUMER_LIST_ITERATOR consumer_list_iterator (this->consumer_list_);
00194        (consumer_i = consumer_list_iterator.next ()) != 0;
00195        consumer_list_iterator.advance ())
00196     {
00197       TAO_AV_Core::deactivate_servant (consumer_i);
00198       delete consumer_i;
00199     }
00200   int result = TAO_AV_Core::deactivate_servant (this);
00201   if (result < 0)
00202     if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_StreamEndPoint::destroy failed\n"));
00203 }

template<class T_Producer, class T_Consumer>
void TAO_FDev< T_Producer, T_Consumer >::flowname ( const char *  flowname  ) 

Definition at line 53 of file Flows_T.cpp.

References CORBA::Exception::_tao_print_exception(), and TAO_FDev< T_Producer, T_Consumer >::flowname_.

00054 {
00055   try
00056     {
00057       CORBA::Any flowname_any;
00058       flowname_any <<= flow_name;
00059       this->define_property ("Flow",
00060                              flowname_any);
00061     }
00062   catch (const CORBA::Exception& ex)
00063     {
00064       ex._tao_print_exception ("TAO_FDev::flowname");
00065     }
00066   this->flowname_ = flow_name;
00067 }

template<class T_Producer, class T_Consumer>
const char * TAO_FDev< T_Producer, T_Consumer >::flowname ( void   ) 

set/get the flowname. create a flow producer object.

Definition at line 46 of file Flows_T.cpp.

References TAO_FDev< T_Producer, T_Consumer >::flowname_.

00047 {
00048   return this->flowname_.in ();
00049 }

template<class T_Producer, class T_Consumer>
AVStreams::FlowConsumer_ptr TAO_FDev< T_Producer, T_Consumer >::make_consumer ( AVStreams::FlowConnection_ptr  the_requester,
AVStreams::QoS the_qos,
CORBA::Boolean_out  met_qos,
char *&  named_fdev 
) [virtual]

bridge method for the application to override the consumer object creation. Default implementation creates a TAO_FlowConsumer.

Definition at line 111 of file Flows_T.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_NEW_RETURN, TAO_FDev< T_Producer, T_Consumer >::consumer_list_, and ACE_DLList< T >::insert_tail().

Referenced by TAO_FDev< T_Producer, T_Consumer >::create_consumer().

00115 {
00116   AVStreams::FlowConsumer_ptr consumer = AVStreams::FlowConsumer::_nil ();
00117   try
00118     {
00119       // Activate the consumer implementation under the Root POA.
00120       T_Consumer *consumer_i;
00121       ACE_NEW_RETURN (consumer_i, T_Consumer, 0 );
00122 
00123       this->consumer_list_.insert_tail (consumer_i);
00124       consumer = consumer_i->_this ();
00125     }
00126   catch (const CORBA::Exception& ex)
00127     {
00128       ex._tao_print_exception ("TAO_FDev::make_consumer");
00129       return consumer;
00130     }
00131   return consumer;
00132 }

template<class T_Producer, class T_Consumer>
AVStreams::FlowProducer_ptr TAO_FDev< T_Producer, T_Consumer >::make_producer ( AVStreams::FlowConnection_ptr  the_requester,
AVStreams::QoS the_qos,
CORBA::Boolean_out  met_qos,
char *&  named_fdev 
) [virtual]

bridge method for the application to override the producer object creation. Default implementation creates a TAO_FlowProducer.

Definition at line 86 of file Flows_T.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_NEW_RETURN, ACE_DLList< T >::insert_tail(), and TAO_FDev< T_Producer, T_Consumer >::producer_list_.

Referenced by TAO_FDev< T_Producer, T_Consumer >::create_producer().

00090 {
00091   AVStreams::FlowProducer_ptr producer = AVStreams::FlowProducer::_nil ();
00092   try
00093     {
00094       // Activate the producer implementation under the Root POA.
00095       T_Producer *producer_i = 0;
00096       ACE_NEW_RETURN (producer_i, T_Producer, 0);
00097       this->producer_list_.insert_tail (producer_i);
00098       producer = producer_i->_this ();
00099     }
00100   catch (const CORBA::Exception& ex)
00101     {
00102       ex._tao_print_exception ("TAO_FDev::make_producer");
00103       return producer;
00104     }
00105   return producer;
00106 }


Member Data Documentation

template<class T_Producer, class T_Consumer>
ACE_DLList<TAO_FlowConsumer> TAO_FDev< T_Producer, T_Consumer >::consumer_list_ [protected]

Definition at line 89 of file Flows_T.h.

Referenced by TAO_FDev< T_Producer, T_Consumer >::make_consumer().

template<class T_Producer, class T_Consumer>
CORBA::String_var TAO_FDev< T_Producer, T_Consumer >::flowname_ [protected]

Definition at line 91 of file Flows_T.h.

Referenced by TAO_FDev< T_Producer, T_Consumer >::flowname().

template<class T_Producer, class T_Consumer>
ACE_DLList<TAO_FlowProducer> TAO_FDev< T_Producer, T_Consumer >::producer_list_ [protected]

Definition at line 87 of file Flows_T.h.

Referenced by TAO_FDev< T_Producer, T_Consumer >::make_producer().


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