Flows_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Flows_T.h
00006  *
00007  *  Flows_T.h,v 5.12 2006/03/14 06:14:24 jtc Exp
00008  *
00009  *  @author Nagarajan Surendran <naga@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_AV_FLOWS_T_H
00015 #define TAO_AV_FLOWS_T_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "orbsvcs/AV/AVStreams_i.h"
00019 
00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 /**
00023  * @class TAO_FDev
00024  * @brief Implementation of the AV/Streams Flow Device.
00025  *        A FlowConnection is used to bind FDevs for flows,
00026  *        much like how a StreamCtrl is used to bind MMDevices for streams.
00027  */
00028 template <class T_Producer, class T_Consumer>
00029 class TAO_FDev :
00030   public virtual POA_AVStreams::FDev,
00031   public virtual TAO_PropertySet
00032 {
00033 public:
00034   /// default constructor
00035   TAO_FDev (void);
00036 
00037   /// constructor taking a flowname.
00038   TAO_FDev (const char *flowname);
00039 
00040   /// Destructor..
00041   ~TAO_FDev (void);
00042 
00043   /// set/get the flowname.
00044   /// create a flow producer object.
00045   const char *flowname (void);
00046   void flowname (const char *flowname);
00047   AVStreams::FlowProducer_ptr create_producer (AVStreams::FlowConnection_ptr the_requester,
00048                                                        AVStreams::QoS & the_qos,
00049                                                        CORBA::Boolean_out met_qos,
00050                                                        char *& named_fdev
00051                                                        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00052     ACE_THROW_SPEC ((CORBA::SystemException,
00053                      AVStreams::streamOpFailed,
00054                      AVStreams::streamOpDenied,
00055                      AVStreams::notSupported,
00056                      AVStreams::QoSRequestFailed));
00057 
00058   /// bridge method for the application to override the producer object
00059   /// creation. Default implementation creates a TAO_FlowProducer.
00060   virtual AVStreams::FlowProducer_ptr make_producer (AVStreams::FlowConnection_ptr the_requester,
00061                                                        AVStreams::QoS & the_qos,
00062                                                        CORBA::Boolean_out met_qos,
00063                                                        char *& named_fdev
00064                                                        ACE_ENV_ARG_DECL_WITH_DEFAULTS);
00065 
00066   /// create a flow consumer object.
00067   virtual AVStreams::FlowConsumer_ptr create_consumer (AVStreams::FlowConnection_ptr the_requester,
00068                                                        AVStreams::QoS & the_qos,
00069                                                        CORBA::Boolean_out met_qos,
00070                                                        char *& named_fdev
00071                                                        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00072     ACE_THROW_SPEC ((CORBA::SystemException,
00073                      AVStreams::streamOpFailed,
00074                      AVStreams::streamOpDenied,
00075                      AVStreams::notSupported,
00076                      AVStreams::QoSRequestFailed));
00077 
00078   /// bridge method for the application to override the consumer object
00079   /// creation. Default implementation creates a TAO_FlowConsumer.
00080   virtual AVStreams::FlowConsumer_ptr make_consumer (AVStreams::FlowConnection_ptr the_requester,
00081                                                        AVStreams::QoS & the_qos,
00082                                                        CORBA::Boolean_out met_qos,
00083                                                        char *& named_fdev
00084                                                        ACE_ENV_ARG_DECL_WITH_DEFAULTS);
00085 
00086   /// bind this FDev with another FDev.
00087   virtual AVStreams::FlowConnection_ptr bind (AVStreams::FDev_ptr peer_device,
00088                                               AVStreams::QoS & the_qos,
00089                                               CORBA::Boolean_out is_met
00090                                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00091     ACE_THROW_SPEC ((CORBA::SystemException,
00092                      AVStreams::streamOpFailed,
00093                      AVStreams::QoSRequestFailed));
00094 
00095   /// multicast bind is not implemented yet.
00096   virtual AVStreams::FlowConnection_ptr bind_mcast (AVStreams::FDev_ptr first_peer,
00097                                                     AVStreams::QoS & the_qos,
00098                                                     CORBA::Boolean_out is_met
00099                                                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00100     ACE_THROW_SPEC ((CORBA::SystemException,
00101                      AVStreams::streamOpFailed,
00102                      AVStreams::QoSRequestFailed));
00103 
00104   /// destroys this FDev.
00105   virtual void destroy (AVStreams::FlowEndPoint_ptr the_ep,
00106                         const char * fdev_name
00107                         ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00108     ACE_THROW_SPEC ((CORBA::SystemException,
00109                      AVStreams::notSupported));
00110 
00111 protected:
00112   ACE_DLList <TAO_FlowProducer> producer_list_;
00113   typedef ACE_DLList_Iterator <TAO_FlowProducer> PRODUCER_LIST_ITERATOR;
00114   ACE_DLList <TAO_FlowConsumer> consumer_list_;
00115   typedef ACE_DLList_Iterator <TAO_FlowConsumer> CONSUMER_LIST_ITERATOR;
00116   CORBA::String_var flowname_;
00117 };
00118 
00119 TAO_END_VERSIONED_NAMESPACE_DECL
00120 
00121 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00122 #include "orbsvcs/AV/Flows_T.cpp"
00123 #endif /*ACE_TEMPLATES_REQUIRE_SOURCE */
00124 
00125 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00126 #pragma implementation ("Flows_T.cpp")
00127 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00128 
00129 #include /**/ "ace/post.h"
00130 #endif /* TAO_AV_FLOWS_T_H */

Generated on Thu Nov 9 13:44:41 2006 for TAO_AV by doxygen 1.3.6