AV_Core.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   AV_Core.h
00006  *
00007  *  AV_Core.h,v 5.35 2005/11/27 12:04:07 ossama Exp
00008  *
00009  *  @author Nagarajan Surendran <naga@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_AV_CORE_H
00014 #define TAO_AV_CORE_H
00015 #include /**/ "ace/pre.h"
00016 
00017 #include "orbsvcs/AV/AV_export.h"
00018 #include "orbsvcs/AVStreamsC.h"
00019 
00020 #include "tao/PortableServer/PortableServer.h"
00021 
00022 #include "ace/Singleton.h"
00023 #include "ace/Unbounded_Set.h"
00024 #include "ace/Null_Mutex.h"
00025 
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027 class ACE_Reactor;
00028 ACE_END_VERSIONED_NAMESPACE_DECL
00029 
00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00031 
00032 class TAO_Base_StreamEndPoint;
00033 class TAO_AV_Connector_Registry;
00034 class TAO_AV_Acceptor_Registry;
00035 class TAO_AV_Acceptor;
00036 class TAO_AV_Connector;
00037 class TAO_FlowSpec_Entry;
00038 class TAO_AV_Transport_Item;
00039 class TAO_AV_Transport_Factory;
00040 class TAO_AV_Flow_Protocol_Item;
00041 class TAO_AV_Flow_Protocol_Factory;
00042 
00043 typedef ACE_Unbounded_Set <TAO_FlowSpec_Entry*> TAO_AV_FlowSpecSet;
00044 typedef ACE_Unbounded_Set_Iterator <TAO_FlowSpec_Entry*> TAO_AV_FlowSpecSetItor;
00045 
00046 typedef ACE_Unbounded_Set<TAO_AV_Transport_Item*> TAO_AV_TransportFactorySet;
00047 typedef ACE_Unbounded_Set_Iterator<TAO_AV_Transport_Item*> TAO_AV_TransportFactorySetItor;
00048 
00049 // typedefs for containers containing the list of loaded Flow_Protocol factories.
00050 typedef ACE_Unbounded_Set<TAO_AV_Flow_Protocol_Item*> TAO_AV_Flow_ProtocolFactorySet;
00051 typedef ACE_Unbounded_Set_Iterator<TAO_AV_Flow_Protocol_Item*> TAO_AV_Flow_ProtocolFactorySetItor;
00052 
00053 /**
00054  * @class TAO_AV_Core
00055  * @brief This class encapsulates access to the TAO AV Core's resources
00056  *        and its state.
00057  */
00058 class TAO_AV_Export TAO_AV_Core
00059 {
00060 public:
00061   enum EndPoint {TAO_AV_ENDPOINT_A,TAO_AV_ENDPOINT_B};
00062 
00063   enum Protocol
00064   {
00065     TAO_AV_NOPROTOCOL = -1,
00066     TAO_AV_TCP        =  0,
00067     TAO_AV_UDP        =  1,
00068     TAO_AV_AAL5       =  2,
00069     TAO_AV_AAL3_4     =  3,
00070     TAO_AV_AAL1       =  4,
00071     TAO_AV_RTP_UDP    =  5,
00072     TAO_AV_RTP_AAL5   =  6,
00073     TAO_AV_IPX        =  7,
00074     TAO_AV_SFP_UDP    =  8,
00075     TAO_AV_UDP_MCAST  =  9,
00076     TAO_AV_RTP_UDP_MCAST = 10,
00077     TAO_AV_SFP_UDP_MCAST = 11,
00078     TAO_AV_QOS_UDP       = 12,
00079     TAO_AV_USERDEFINED_UDP = 13,
00080     TAO_AV_USERDEFINED_UDP_MCAST = 14,
00081     TAO_AV_SCTP_SEQ =  15
00082   };
00083 
00084   enum Flow_Component
00085   {
00086     TAO_AV_DATA = 1,
00087     TAO_AV_CONTROL = 2,
00088     TAO_AV_BOTH = 3
00089   };
00090 
00091   /// Default constructor.
00092   TAO_AV_Core (void);
00093 
00094   /// Destructor.
00095   ~TAO_AV_Core (void);
00096 
00097   int init (CORBA::ORB_ptr orb,
00098             PortableServer::POA_ptr poa
00099             ACE_ENV_ARG_DECL);
00100   int run (void);
00101   int stop_run (void);
00102   int init_forward_flows (TAO_Base_StreamEndPoint *endpoint,
00103                           TAO_AV_FlowSpecSet &flow_spec_set,
00104                           EndPoint direction,
00105                           AVStreams::flowSpec &flow_spec);
00106   int init_reverse_flows (TAO_Base_StreamEndPoint *endpoint,
00107                           TAO_AV_FlowSpecSet &forward_flow_spec_set,
00108                           TAO_AV_FlowSpecSet &reverse_flow_spec_set,
00109                           EndPoint direction);
00110   int init_transport_factories (void);
00111   int init_flow_protocol_factories (void);
00112 
00113   int load_default_transport_factories (void);
00114   int load_default_flow_protocol_factories (void);
00115 
00116   /// = Get the acceptor registry
00117   TAO_AV_Acceptor *get_acceptor (const char *flowname);
00118   TAO_AV_Connector *get_connector (const char *flowname);
00119   int remove_acceptor (const char *flowname);
00120   int remove_connector (const char *flowname);
00121   TAO_AV_Connector_Registry *connector_registry (void);
00122   TAO_FlowSpec_Entry *get_flow_spec_entry (TAO_AV_FlowSpecSet &flow_spec_set,
00123                                            const char *flowname);
00124   TAO_AV_Acceptor_Registry  *acceptor_registry  (void);
00125 
00126   // = Get the protocol factories
00127   /// = Set/get the <ACE_Reactor>.
00128   TAO_AV_Flow_Protocol_Factory *get_flow_protocol_factory(const char *flow_protocol);
00129   TAO_AV_Transport_Factory *get_transport_factory(const char *transport_protocol);
00130   TAO_AV_Flow_ProtocolFactorySet *flow_protocol_factories (void);
00131   TAO_AV_TransportFactorySet *transport_factories (void);
00132   void reactor (ACE_Reactor *r);
00133   ACE_Reactor *reactor (void);
00134   CORBA::ORB_ptr orb (void);
00135   void orb (CORBA::ORB_ptr orb_);
00136   PortableServer::POA_ptr poa (void);
00137   void poa (PortableServer::POA_ptr poa_);
00138 
00139   static int deactivate_servant (PortableServer::Servant servant);
00140   static char *get_flowname (const char *flow_spec_entry_str);
00141   static ACE_CString get_control_flowname(const char *flowname);
00142 
00143 protected:
00144   /// The connector registry which all active connecters must register
00145   /// themselves with.
00146   TAO_AV_Connector_Registry *connector_registry_;
00147 
00148   /// The registry which maintains a list of acceptor factories for each
00149   /// loaded protocol.
00150   TAO_AV_Acceptor_Registry *acceptor_registry_;
00151 
00152   /// Pointer to the list of transports loaded into this AV_Core instance.
00153   TAO_AV_TransportFactorySet transport_factories_;
00154 
00155   /// Pointer to the list of flow protocol loaded into this AV_Core instance.
00156   TAO_AV_Flow_ProtocolFactorySet flow_protocol_factories_;
00157 
00158   ACE_Reactor *reactor_;
00159   CORBA::ORB_var orb_;
00160   PortableServer::POA_var poa_;
00161   CORBA::Boolean stop_run_;
00162 };
00163 
00164 #if defined (__BORLANDC__)
00165 # if !defined (TAO_AV_BUILD_DLL)
00166 #   pragma option push -Jgx
00167 # endif
00168 #endif
00169 TAO_AV_SINGLETON_DECLARE (ACE_Singleton, TAO_AV_Core, ACE_Null_Mutex)
00170 #if defined (__BORLANDC__)
00171 # if !defined(TAO_AV_BUILD_DLL)
00172 #   pragma option pop
00173 # endif
00174 #endif
00175 
00176 typedef ACE_Singleton<TAO_AV_Core, ACE_Null_Mutex> TAO_AV_CORE;
00177 
00178 TAO_END_VERSIONED_NAMESPACE_DECL
00179 
00180 #include /**/ "ace/post.h"
00181 #endif /* TAO_AV_CORE_H */

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