00001 /*-*- C++ -*- */ 00002 00003 //============================================================================= 00004 /** 00005 * @file Registry_Name_Space.h 00006 * 00007 * $Id: Registry_Name_Space.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $ 00008 * 00009 * @author Irfan Pyarali (irfan@cs.wustl.edu) 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef ACE_REGISTRY_NAME_SPACE_H 00015 #define ACE_REGISTRY_NAME_SPACE_H 00016 #include "ace/pre.h" 00017 00018 #include "ace/OS.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #if (defined (ACE_WIN32) && defined (UNICODE)) 00025 // This only works on Win32 platforms when UNICODE is turned on 00026 00027 #include "ace/Registry.h" 00028 #include "ace/Naming_Context.h" 00029 #include "ace/Name_Space.h" 00030 00031 /** 00032 * @class ACE_Registry_Name_Space 00033 * 00034 * @brief Interface to a Name Server Database which is maintained by 00035 * the Win32 Registry. Allows to add, change, remove and 00036 * resolve NameBindings. 00037 * 00038 * Manages a Naming Service for a registry name space which 00039 * includes bindings for all contexts. All strings are stored in 00040 * wide character format. A Name Binding consists of a name 00041 * (that's the key), a value string. There is no type string 00042 * support in this Name Space. 00043 */ 00044 class ACE_Export ACE_Registry_Name_Space : public ACE_Name_Space 00045 { 00046 public: 00047 00048 /// Constructor 00049 ACE_Registry_Name_Space (void); 00050 00051 /// Contacts and opens the registry on the specified server 00052 ACE_Registry_Name_Space (ACE_Name_Options *name_options); 00053 00054 /// Destructor 00055 ~ACE_Registry_Name_Space (void); 00056 00057 /// Contacts and opens the registry on the specified server 00058 int open (ACE_Name_Options *name_options); 00059 00060 /// Bind a new name to a naming context (Wide character strings). 00061 int bind (const ACE_NS_WString &name_in, 00062 const ACE_NS_WString &value_in, 00063 const char *type_in = ""); 00064 00065 /** 00066 * Overwrite the value or type of an existing name in a 00067 * ACE_Name_Space or bind a new name to the context, if it didn't 00068 * exist yet. (Wide charcter strings interface). 00069 */ 00070 int rebind (const ACE_NS_WString &name_in, 00071 const ACE_NS_WString &value_in, 00072 const char *type_in = ""); 00073 00074 /// Delete a name from a ACE_Name_Space (Wide charcter strings 00075 /// Interface). 00076 int unbind (const ACE_NS_WString &name_in); 00077 00078 /// Get value and type of a given name binding (Wide chars). The 00079 /// caller is responsible for deleting both <value_out> and <type_out>! 00080 int resolve (const ACE_NS_WString &name_in, 00081 ACE_NS_WString &value_out, 00082 char *&type_out); 00083 00084 /// Get a set of names matching a specified pattern (wchars). Matching 00085 /// means the names must begin with the pattern string. 00086 int list_names (ACE_WSTRING_SET &set_out, 00087 const ACE_NS_WString &pattern_in); 00088 00089 /// Get a set of values matching a specified pattern (wchars). Matching 00090 /// means the values must begin with the pattern string. 00091 int list_values (ACE_WSTRING_SET &set_out, 00092 const ACE_NS_WString &pattern_in); 00093 00094 /// Get a set of types matching a specified pattern (wchars). Matching 00095 /// means the types must begin with the pattern string. 00096 int list_types (ACE_WSTRING_SET &set_out, 00097 const ACE_NS_WString &pattern_in); 00098 00099 /** 00100 * Get a set of names matching a specified pattern (wchars). Matching 00101 * means the names must begin with the pattern string. Returns the 00102 * complete binding associated each pattern match. 00103 */ 00104 int list_name_entries (ACE_BINDING_SET &set, 00105 const ACE_NS_WString &pattern); 00106 00107 /** 00108 * Get a set of values matching a specified pattern (wchars). Matching 00109 * means the values must begin with the pattern string. Returns the 00110 * complete binding associated each pattern match. 00111 */ 00112 int list_value_entries (ACE_BINDING_SET &set, 00113 const ACE_NS_WString &pattern); 00114 00115 /** 00116 * Get a set of types matching a specified pattern (wchars). Matching 00117 * means the types must begin with the pattern string. Returns the 00118 * complete binding associated each pattern match. 00119 */ 00120 int list_type_entries (ACE_BINDING_SET &set, 00121 const ACE_NS_WString &pattern); 00122 00123 /// Dump the state of the object 00124 void dump (void) const; 00125 00126 private: 00127 00128 /// current context 00129 ACE_Registry::Naming_Context context_; 00130 }; 00131 00132 #endif /* ACE_WIN32 && UNICODE */ 00133 #include "ace/post.h" 00134 #endif /* ACE_REGISTRY_NAME_SPACE_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002