⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 avstreams_i.h

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 H
📖 第 1 页 / 共 5 页
字号:

//=============================================================================
/**
 *  @file   AVStreams_i.h
 *
 *  AVStreams_i.h,v 5.47 2003/07/25 22:08:36 parsons Exp
 *
 *  @author Sumedh Mungee <sumedh@cs.wustl.edu> Nagarajan Surendran <naga@cs.wustl.edu>
 */
//=============================================================================

#ifndef AVSTREAMS_I_H
#define AVSTREAMS_I_H
#include /**/ "ace/pre.h"

#include "ace/OS.h"
#include "ace/SOCK_Dgram_Mcast.h"
#include "ace/ATM_Addr.h"
#include "ace/Containers_T.h"
#include "ace/Process.h"
#include "ace/SOCK_CODgram.h"
#include "ace/SOCK_Connector.h"
#include "ace/Connector.h"
#include "ace/Acceptor.h"
#include "ace/SOCK_Stream.h"
#include "ace/Svc_Handler.h"
#include "ace/SOCK_Acceptor.h"

#include "tao/PortableServer/ORB_Manager.h"
#include "orbsvcs/AV/AV_export.h"
#include "orbsvcs/CosPropertyServiceS.h"
#include "orbsvcs/AVStreamsS.h"
#include "orbsvcs/Property/CosPropertyService_i.h"
#include "orbsvcs/CosNamingC.h"
#include "orbsvcs/AV/AV_Core.h"
#include "orbsvcs/AV/Endpoint_Strategy.h"
#include "orbsvcs/Null_MediaCtrlS.h"

#if defined (TAO_ORBSVCS_HAS_Trader)
#include "orbsvcs/Trader/Trader.h"
#endif /* TAO_ORBSVCS_HAS_Trader */

#include "orbsvcs/AV/FlowSpec_Entry.h"

#define FLOWSPEC_MAX 5
// for the Hash_Map helper classes.

// This is to remove "inherits via dominance" warnings from MSVC.
// MSVC is being a little too paranoid.
#if defined (_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#endif /* _MSC_VER >= 1200 */
# pragma warning (disable : 4250)
#endif /* _MSC_VER */

typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FlowEndPoint_var,ACE_Null_Mutex>  FlowEndPoint_Map;
typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FlowEndPoint_var> FlowEndPoint_Map_Entry;
typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FlowEndPoint_var,ACE_Null_Mutex>  FlowEndPoint_Map_Iterator;

typedef ACE_Hash_Map_Manager <ACE_CString,TAO_AV_Flow_Handler*,ACE_Null_Mutex>  Flow_Handler_Map;
typedef ACE_Hash_Map_Entry <ACE_CString,TAO_AV_Flow_Handler*> Flow_Handler_Map_Entry;
typedef ACE_Hash_Map_Iterator <ACE_CString,TAO_AV_Flow_Handler*,ACE_Null_Mutex>  Flow_Handler_Map_Iterator;


#include "AV_Core.h"

class TAO_AV_Export AV_Null_MediaCtrl
  : public virtual POA_Null_MediaCtrl,
    public virtual PortableServer::RefCountServantBase
{
public:
  AV_Null_MediaCtrl (void);
};

/**
 * @class TAO_Basic_StreamCtrl
 * @brief Base class for StreamCtrl, implements basic stream start
 *        and stop functionality.
 */
class TAO_AV_Export TAO_Basic_StreamCtrl
  : public virtual POA_AVStreams::Basic_StreamCtrl,
    public virtual TAO_PropertySet,
    public virtual PortableServer::RefCountServantBase
{

public:
  /// Default Constructor
  TAO_Basic_StreamCtrl (void);

  /// Destructor.
  virtual ~TAO_Basic_StreamCtrl (void);

  /// Stop the transfer of data of the stream
  /// Empty the_spec means apply operation to all flows
  virtual void stop (const AVStreams::flowSpec &the_spec
                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /// Start the transfer of data in the stream.
  /// Empty the_spec means apply operation to all flows
  virtual void start (const AVStreams::flowSpec &the_spec
                      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /**
   * Tears down the stream. This will close the connection, and delete
   * the streamendpoint and vdev associated with this stream
   * Empty the_spec means apply operation to all flows
   */
  virtual void destroy (const AVStreams::flowSpec &the_spec
                        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /// Changes the QoS associated with the stream
  /// Empty the_spec means apply operation to all flows
  virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
                                     const AVStreams::flowSpec &the_spec
                                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::QoSRequestFailed));

  /// Used by StreamEndPoint and VDev to inform StreamCtrl of events.
  /// E.g., loss of flow, reestablishment of flow, etc..
  virtual void push_event (const struct CosPropertyService::Property & the_event
                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException));

  /// Used to control the flow protocol parameters.
  virtual void set_FPStatus (const AVStreams::flowSpec &the_spec,
                             const char *fp_name,
                             const CORBA::Any &fp_settings
                             ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::FPError));

  /// Not implemented in the light profile, will raise the notsupported
  /// exception
  virtual CORBA::Object_ptr get_flow_connection (const char *flow_name
                                                 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::notSupported));

  /// Not implemented in the light profile, will raise the notsupported
  /// exception
  virtual void set_flow_connection (const char *flow_name,
                                    CORBA::Object_ptr flow_connection
                                    ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::notSupported));

protected:

  /// The Virtual Devices for this stream
  AVStreams::VDev_var vdev_a_;
  AVStreams::VDev_var vdev_b_;

  /// The Endpoints for this stream
  AVStreams::StreamEndPoint_A_var sep_a_;
  AVStreams::StreamEndPoint_B_var sep_b_;

  /// Hash table for the flow names and its corresponding flowconnection object reference.
  typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> FlowConnection_Map;
  typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> FlowConnection_Map_Iterator;
  typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FlowConnection_var> FlowConnection_Map_Entry;
  FlowConnection_Map flow_connection_map_;
  AVStreams::FlowConnection_seq flowConnections_;

  ///sequence of flow names.
  u_int flow_count_;
  AVStreams::flowSpec flows_;
};

class TAO_AV_Export TAO_Negotiator
  : public POA_AVStreams::Negotiator,
    public virtual PortableServer::RefCountServantBase
{
public:
  virtual CORBA::Boolean negotiate (AVStreams::Negotiator_ptr remote_negotiator,
                                    const AVStreams::streamQoS &qos_spec
                                    ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException));
};

class TAO_MCastConfigIf;

class TAO_AV_Export MMDevice_Map_Hash_Key
{
public:
  /// default constructor.
  MMDevice_Map_Hash_Key (void);

  /// constructor.
  MMDevice_Map_Hash_Key (AVStreams::MMDevice_ptr mmdevice);

  /// copy constructor.
  MMDevice_Map_Hash_Key (const MMDevice_Map_Hash_Key&);

  /// destructor.
  ~MMDevice_Map_Hash_Key (void);

  /// operator== needed by  ACE_Hash_Map_Manager.
  int operator == (const MMDevice_Map_Hash_Key &hash_key) const;

  /// operator== needed by  ACE_Hash_Map_Manager.
  friend int operator < (const MMDevice_Map_Hash_Key &left,
                         const MMDevice_Map_Hash_Key &right);

  /// hash function for this mmdevice.
  u_long hash (void) const;

  static const int hash_maximum_;
protected:
  AVStreams::MMDevice_ptr mmdevice_;
};

/**
 * @class TAO_StreamCtrl
 * @brief Implementation the A/V StreamCtrl class. this class
 *        is used to control the stream. It should be subclassed
 *        by applications that want to provide more control features.
 */
class TAO_AV_Export TAO_StreamCtrl
  : public virtual POA_AVStreams::StreamCtrl,
    public virtual TAO_Basic_StreamCtrl,
    public virtual PortableServer::RefCountServantBase
{

public:

  /// Default Constructor
  TAO_StreamCtrl (void);

  /// virtual destructor.
  virtual ~TAO_StreamCtrl (void);

  /// Stop the transfer of data of the stream
  /// Empty the_spec means apply operation to all flows
  virtual void stop (const AVStreams::flowSpec &the_spec
                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /// Start the transfer of data in the stream.
  /// Empty the_spec means apply operation to all flows
  virtual void start (const AVStreams::flowSpec &the_spec
                      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /**
   * Tears down the stream. This will close the connection, and delete
   * the streamendpoint and vdev associated with this stream
   * Empty the_spec means apply operation to all flows
   */
  virtual void destroy (const AVStreams::flowSpec &the_spec
                        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /**
   * Establish a stream between a_party and b_party,
   * with qos the_qos, and for the flows in the_flows
   * if the_flows is empty, bind all the flows
   * Causes a connection to be established between the StreamEndpoints.
   * Returns success/failure
   */
  virtual CORBA::Boolean bind_devs (AVStreams::MMDevice_ptr a_party,
                                    AVStreams::MMDevice_ptr b_party,
                                    AVStreams::streamQoS& the_qos,
                                    const AVStreams::flowSpec& the_flows
                                    ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::streamOpFailed,
                     AVStreams::noSuchFlow,
                     AVStreams::QoSRequestFailed));

  /**
   * Establish a connection between two streamendpoints. This can
   * be used if the streamendpoints have been created independent of
   * a MMDevice
   */
  virtual CORBA::Boolean bind (AVStreams::StreamEndPoint_A_ptr a_party,
                               AVStreams::StreamEndPoint_B_ptr b_party,
                               AVStreams::streamQoS &the_qos,
                               const AVStreams::flowSpec &the_flows
                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   AVStreams::streamOpFailed,
                   AVStreams::noSuchFlow,
                   AVStreams::QoSRequestFailed));

  virtual void unbind_dev (AVStreams::MMDevice_ptr dev,
                           const AVStreams::flowSpec & the_spec
                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::streamOpFailed,
                     AVStreams::noSuchFlow));

  /// Unbind the_ep from the stream. Empty the_spec means apply to all flows.
  virtual void unbind_party (AVStreams::StreamEndPoint_ptr the_ep,
                             const AVStreams::flowSpec &the_spec
                             ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::streamOpFailed,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -