00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ACE_LOCAL_NAME_SPACE_T_H
00016 #define ACE_LOCAL_NAME_SPACE_T_H
00017 #include "ace/pre.h"
00018
00019 #include "ace/Name_Space.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif
00024
00025 #include "ace/Naming_Context.h"
00026 #include "ace/SString.h"
00027 #include "ace/Local_Name_Space.h"
00028 #include "ace/Null_Mutex.h"
00029
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031
00032
00033
00034 typedef ACE_Unbounded_Set<ACE_NS_WString> ACE_WSTRING_SET;
00035
00036 ACE_END_VERSIONED_NAMESPACE_DECL
00037
00038
00039 #if (1)
00040 # include "ace/Hash_Map_Manager_T.h"
00041 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00042 typedef ACE_Hash_Map_Manager_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex> MAP_MANAGER;
00043 ACE_END_VERSIONED_NAMESPACE_DECL
00044 #else
00045 # include "ace/Map_Manager.h"
00046 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00047 typedef ACE_Map_Manager<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> MAP_MANAGER;
00048 ACE_END_VERSIONED_NAMESPACE_DECL
00049 #endif
00050
00051 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00052
00053
00054 typedef MAP_MANAGER::ITERATOR MAP_ITERATOR;
00055 typedef MAP_MANAGER::ENTRY MAP_ENTRY;
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 template <class ALLOCATOR>
00072 class ACE_Name_Space_Map : public MAP_MANAGER
00073 {
00074 public:
00075
00076 ACE_Name_Space_Map (ALLOCATOR *alloc);
00077
00078
00079
00080
00081
00082 int bind (const ACE_NS_String &,
00083 const ACE_NS_Internal &,
00084 ALLOCATOR *alloc);
00085
00086 int unbind (const ACE_NS_String &,
00087 ACE_NS_Internal &,
00088 ALLOCATOR *alloc);
00089
00090 int rebind (const ACE_NS_String &,
00091 const ACE_NS_Internal &,
00092 ACE_NS_String &,
00093 ACE_NS_Internal &,
00094 ALLOCATOR *alloc);
00095
00096 int find (const ACE_NS_String &,
00097 ACE_NS_Internal &,
00098 ALLOCATOR *alloc);
00099
00100 int close (ALLOCATOR *alloc);
00101 };
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 template <ACE_MEM_POOL_1, class ACE_LOCK>
00117 class ACE_Local_Name_Space : public ACE_Name_Space
00118 {
00119 public:
00120
00121
00122 ACE_Local_Name_Space (void);
00123
00124
00125
00126
00127
00128
00129 ACE_Local_Name_Space (ACE_Naming_Context::Context_Scope_Type scope_in,
00130 ACE_Name_Options *name_options);
00131
00132
00133
00134
00135
00136
00137 int open (ACE_Naming_Context::Context_Scope_Type scope_in);
00138
00139
00140
00141 ~ACE_Local_Name_Space (void);
00142
00143
00144 virtual int bind (const ACE_NS_WString &name,
00145 const ACE_NS_WString &value,
00146 const char *type = "");
00147
00148
00149
00150
00151
00152
00153 virtual int rebind (const ACE_NS_WString &name,
00154 const ACE_NS_WString &value,
00155 const char *type = "");
00156
00157
00158
00159 virtual int unbind (const ACE_NS_WString &name);
00160 virtual int unbind_i (const ACE_NS_WString &name);
00161
00162
00163
00164 virtual int resolve (const ACE_NS_WString &name,
00165 ACE_NS_WString &value,
00166 char *&type);
00167 virtual int resolve_i (const ACE_NS_WString &name,
00168 ACE_NS_WString &value,
00169 char *&type);
00170
00171
00172
00173 virtual int list_names (ACE_WSTRING_SET &set,
00174 const ACE_NS_WString &pattern);
00175 virtual int list_names_i (ACE_WSTRING_SET &set,
00176 const ACE_NS_WString &pattern);
00177
00178
00179
00180 virtual int list_values (ACE_WSTRING_SET &set,
00181 const ACE_NS_WString &pattern);
00182 virtual int list_values_i (ACE_WSTRING_SET &set,
00183 const ACE_NS_WString &pattern);
00184
00185
00186
00187 virtual int list_types (ACE_WSTRING_SET &set,
00188 const ACE_NS_WString &pattern);
00189 virtual int list_types_i (ACE_WSTRING_SET &set,
00190 const ACE_NS_WString &pattern);
00191
00192
00193
00194
00195
00196
00197 virtual int list_name_entries (ACE_BINDING_SET &set,
00198 const ACE_NS_WString &pattern);
00199 virtual int list_name_entries_i (ACE_BINDING_SET &set,
00200 const ACE_NS_WString &pattern);
00201
00202
00203
00204
00205
00206
00207 virtual int list_value_entries (ACE_BINDING_SET &set,
00208 const ACE_NS_WString &pattern);
00209 virtual int list_value_entries_i (ACE_BINDING_SET &set,
00210 const ACE_NS_WString &pattern);
00211
00212
00213
00214
00215
00216
00217 virtual int list_type_entries (ACE_BINDING_SET &set,
00218 const ACE_NS_WString &pattern);
00219 virtual int list_type_entries_i (ACE_BINDING_SET &set,
00220 const ACE_NS_WString &pattern);
00221
00222
00223 virtual void dump (void) const;
00224 virtual void dump_i (void) const;
00225
00226
00227 typedef ACE_Allocator_Adapter <ACE_Malloc <ACE_MEM_POOL_2, ACE_LOCK> >
00228 ALLOCATOR;
00229
00230 private:
00231 #if defined (ACE_WIN32)
00232
00233 int remap (EXCEPTION_POINTERS *ep);
00234 #endif
00235
00236
00237 int shared_bind (const ACE_NS_WString &name,
00238 const ACE_NS_WString &value,
00239 const char *type, int rebind);
00240 int shared_bind_i (const ACE_NS_WString &name,
00241 const ACE_NS_WString &value,
00242 const char *type, int rebind);
00243
00244
00245
00246 int create_manager (void);
00247 int create_manager_i (void);
00248
00249
00250 ALLOCATOR *allocator_;
00251
00252
00253 ACE_Name_Space_Map <ALLOCATOR> *name_space_map_;
00254
00255
00256
00257 ACE_Naming_Context::Context_Scope_Type ns_scope_;
00258
00259
00260 ACE_Name_Options *name_options_;
00261
00262
00263 ACE_TCHAR context_file_[MAXPATHLEN + MAXNAMELEN];
00264
00265
00266 ACE_LOCK *lock_;
00267 };
00268
00269 ACE_END_VERSIONED_NAMESPACE_DECL
00270
00271 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00272 #include "ace/Local_Name_Space_T.cpp"
00273 #endif
00274
00275 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00276 #pragma implementation ("Local_Name_Space_T.cpp")
00277 #endif
00278
00279 #include "ace/post.h"
00280 #endif