00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TAO_PORTABLE_GROUP_MAP_H
00014 #define TAO_PORTABLE_GROUP_MAP_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 #include "orbsvcs/PortableGroupC.h"
00025
00026 #include "tao/Object_KeyC.h"
00027
00028 #include "ace/Null_Mutex.h"
00029 #include "ace/Hash_Map_Manager_T.h"
00030
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032
00033 class TAO_ServerRequest;
00034
00035
00036
00037
00038
00039
00040
00041
00042 class TAO_PortableGroup_Export TAO_GroupId_Hash
00043 {
00044 public:
00045
00046
00047 u_long operator () (const PortableGroup::TagGroupTaggedComponent *id) const;
00048 };
00049
00050
00051
00052
00053
00054
00055
00056
00057 class TAO_PortableGroup_Export TAO_GroupId_Equal_To
00058 {
00059 public:
00060
00061
00062 int operator () (const PortableGroup::TagGroupTaggedComponent *lhs,
00063 const PortableGroup::TagGroupTaggedComponent *rhs) const;
00064 };
00065
00066
00067
00068
00069
00070
00071 class TAO_PortableGroup_Export TAO_Portable_Group_Map
00072 {
00073 public:
00074
00075
00076
00077
00078
00079
00080 struct Map_Entry
00081 {
00082
00083 TAO::ObjectKey key;
00084
00085
00086 struct Map_Entry *next;
00087 };
00088
00089
00090 TAO_Portable_Group_Map ();
00091
00092
00093 ~TAO_Portable_Group_Map (void);
00094
00095
00096
00097 void add_groupid_objectkey_pair (PortableGroup::TagGroupTaggedComponent *group_id,
00098 const TAO::ObjectKey &key
00099 ACE_ENV_ARG_DECL);
00100
00101
00102
00103 void remove_groupid_objectkey_pair (const PortableGroup::TagGroupTaggedComponent* group_id,
00104 const TAO::ObjectKey &key
00105 ACE_ENV_ARG_DECL);
00106
00107
00108
00109 void dispatch (PortableGroup::TagGroupTaggedComponent* group_id,
00110 TAO_ORB_Core *orb_core,
00111 TAO_ServerRequest &request,
00112 CORBA::Object_out forward_to
00113 ACE_ENV_ARG_DECL);
00114
00115
00116 typedef ACE_Hash_Map_Manager_Ex<
00117 PortableGroup::TagGroupTaggedComponent *,
00118 Map_Entry *,
00119 TAO_GroupId_Hash,
00120 TAO_GroupId_Equal_To,
00121 ACE_Null_Mutex> GroupId_Table;
00122 typedef GroupId_Table::iterator Iterator;
00123
00124 protected:
00125
00126 TAO_SYNCH_MUTEX lock_;
00127
00128
00129 GroupId_Table map_;
00130 };
00131
00132 TAO_END_VERSIONED_NAMESPACE_DECL
00133
00134
00135
00136
00137
00138 #include "ace/post.h"
00139 #endif