3 //=============================================================================
5 * @file Registry_Name_Space.h
7 * @author Irfan Pyarali (irfan@cs.wustl.edu)
9 //=============================================================================
12 #ifndef ACE_REGISTRY_NAME_SPACE_H
13 #define ACE_REGISTRY_NAME_SPACE_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #if (defined (ACE_WIN32) && defined (ACE_USES_WCHAR))
23 // This only works on Win32 platforms when ACE_USES_WCHAR is turned on
25 #include "ace/Registry.h"
26 #include "ace/Naming_Context.h"
27 #include "ace/Name_Space.h"
29 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
32 * @class ACE_Registry_Name_Space
34 * @brief Interface to a Name Server Database which is maintained by
35 * the Win32 Registry. Allows to add, change, remove and
36 * resolve NameBindings.
38 * Manages a Naming Service for a registry name space which
39 * includes bindings for all contexts. All strings are stored in
40 * wide character format. A Name Binding consists of a name
41 * (that's the key), a value string. There is no type string
42 * support in this Name Space.
44 class ACE_Export ACE_Registry_Name_Space
: public ACE_Name_Space
48 ACE_Registry_Name_Space () = default;
50 /// Contacts and opens the registry on the specified server
51 ACE_Registry_Name_Space (ACE_Name_Options
*name_options
);
54 ~ACE_Registry_Name_Space () = default;
56 /// Contacts and opens the registry on the specified server
57 int open (ACE_Name_Options
*name_options
);
59 /// Bind a new name to a naming context (Wide character strings).
60 int bind (const ACE_NS_WString
&name_in
,
61 const ACE_NS_WString
&value_in
,
62 const char *type_in
= "");
65 * Overwrite the value or type of an existing name in a
66 * ACE_Name_Space or bind a new name to the context, if it didn't
67 * exist yet. (Wide character strings interface).
69 int rebind (const ACE_NS_WString
&name_in
,
70 const ACE_NS_WString
&value_in
,
71 const char *type_in
= "");
73 /// Delete a name from a ACE_Name_Space (Wide character strings
75 int unbind (const ACE_NS_WString
&name_in
);
77 /// Get value and type of a given name binding (Wide chars). The
78 /// caller is responsible for deleting both @a value_out and @a type_out!
79 int resolve (const ACE_NS_WString
&name_in
,
80 ACE_NS_WString
&value_out
,
83 /// Get a set of names matching a specified pattern (wchars). Matching
84 /// means the names must begin with the pattern string.
85 int list_names (ACE_WSTRING_SET
&set_out
,
86 const ACE_NS_WString
&pattern_in
);
88 /// Get a set of values matching a specified pattern (wchars). Matching
89 /// means the values must begin with the pattern string.
90 int list_values (ACE_WSTRING_SET
&set_out
,
91 const ACE_NS_WString
&pattern_in
);
93 /// Get a set of types matching a specified pattern (wchars). Matching
94 /// means the types must begin with the pattern string.
95 int list_types (ACE_WSTRING_SET
&set_out
,
96 const ACE_NS_WString
&pattern_in
);
99 * Get a set of names matching a specified pattern (wchars). Matching
100 * means the names must begin with the pattern string. Returns the
101 * complete binding associated each pattern match.
103 int list_name_entries (ACE_BINDING_SET
&set
,
104 const ACE_NS_WString
&pattern
);
107 * Get a set of values matching a specified pattern (wchars). Matching
108 * means the values must begin with the pattern string. Returns the
109 * complete binding associated each pattern match.
111 int list_value_entries (ACE_BINDING_SET
&set
,
112 const ACE_NS_WString
&pattern
);
115 * Get a set of types matching a specified pattern (wchars). Matching
116 * means the types must begin with the pattern string. Returns the
117 * complete binding associated each pattern match.
119 int list_type_entries (ACE_BINDING_SET
&set
,
120 const ACE_NS_WString
&pattern
);
122 /// Dump the state of the object
127 ACE_Registry::Naming_Context context_
;
130 ACE_END_VERSIONED_NAMESPACE_DECL
132 #endif /* ACE_WIN32 && ACE_USES_WCHAR */
134 #include /**/ "ace/post.h"
136 #endif /* ACE_REGISTRY_NAME_SPACE_H */