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