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

📄 portable_group_map.h

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

//=============================================================================
/**
 *  @file   Portable_Group_Map.h
 *
 *  Portable_Group_Map.h,v 1.11 2004/01/02 20:16:11 elliott_c Exp
 *
 *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
 */
//=============================================================================

#ifndef TAO_PORTABLE_GROUP_MAP_H
#define TAO_PORTABLE_GROUP_MAP_H

#include /**/ "ace/pre.h"
#include "ace/Null_Mutex.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Hash_Map_Manager_T.h"

#include "portablegroup_export.h"
#include "orbsvcs/PortableGroupC.h"

#include "tao/Object_KeyC.h"

class TAO_ServerRequest;

/**
 * @class TAO_GroupId_Hash
 *
 * @brief Hashing class for Group Ids.
 *
 * Define the hash() method for Group Ids.
 */
class TAO_PortableGroup_Export TAO_GroupId_Hash
{
public:

  /// Returns hash value.
  u_long operator () (const PortableGroup::TagGroupTaggedComponent *id) const;
};

/**
 * @class TAO_GroupId_Equal_To
 *
 * @brief Hashing class for Group Ids.
 *
 * Define the Equal_To () method for Object Ids.
 */
class TAO_PortableGroup_Export TAO_GroupId_Equal_To
{
public:

  /// Returns 1 if equal.
  int operator () (const PortableGroup::TagGroupTaggedComponent *lhs,
                   const PortableGroup::TagGroupTaggedComponent *rhs) const;
};

/**
 * @class TAO_Portable_Group_Map
 *
 * @brief Map of GroupIds to ObjectKeys.
 */
class TAO_PortableGroup_Export TAO_Portable_Group_Map
{
public:

  /**
   * @struct Map_Entry
   *
   * @brief Value field of the portable group map.
   */
  struct Map_Entry
  {
    /// The key.
    TAO::ObjectKey key;

    /// next ObjectKey in the group.
    struct Map_Entry *next;
  };

  /// Constructor.
  TAO_Portable_Group_Map ();

  /// Destructor.
  ~TAO_Portable_Group_Map (void);

  /// Add a GroupId->ObjectKey mapping to the map.
  /// This function takes ownership of the memory pointed to be group_id
  void add_groupid_objectkey_pair (PortableGroup::TagGroupTaggedComponent *group_id,
                                   const TAO::ObjectKey &key
                                   ACE_ENV_ARG_DECL);


  /// Remove a GroupId->ObjectKey mapping from the map.
  void remove_groupid_objectkey_pair (const PortableGroup::TagGroupTaggedComponent* group_id,
                                      const TAO::ObjectKey &key
                                      ACE_ENV_ARG_DECL);

  /// Dispatch a request to all of the ObjectIds that belong to
  /// the specified group.
  void dispatch (PortableGroup::TagGroupTaggedComponent* group_id,
                                    TAO_ORB_Core *orb_core,
                                    TAO_ServerRequest &request,
                                    CORBA::Object_out forward_to
                                    ACE_ENV_ARG_DECL);

  /// Id hash map.
  typedef ACE_Hash_Map_Manager_Ex<
    PortableGroup::TagGroupTaggedComponent *,
    Map_Entry *,
    TAO_GroupId_Hash,
    TAO_GroupId_Equal_To,
    ACE_Null_Mutex> GroupId_Table;
  typedef GroupId_Table::iterator Iterator;

protected:
  /// @@ Frank: This class will need a mutex to protect
  ///    this eventually...

  /// Id map.
  GroupId_Table map_;
};



//#if defined (__ACE_INLINE__)
//# include "Portable_Group_Map.i"
//#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"
#endif /* TAO_PORTABLE_GROUP_MAP_H */

⌨️ 快捷键说明

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