3 //==========================================================================
5 * @file Remote_Name_Space.h
7 * @author Prashant Jain
9 //==========================================================================
12 #ifndef ACE_REMOTE_NAME_SPACE_H
13 #define ACE_REMOTE_NAME_SPACE_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/ACE_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ace/Name_Proxy.h"
24 #include "ace/Name_Space.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 typedef ACE_Unbounded_Set
<ACE_NS_WString
> ACE_WSTRING_SET
;
33 * @class ACE_Remote_Name_Space
35 * @brief Maintaining accesses Remote Name Server Database. Allows to
36 * add NameBindings, change them, remove them and resolve
39 * Manages a Naming Service for a remote name space which
40 * includes bindings for net_local naming context. All strings
41 * are stored in wide character format. A Name Binding consists
42 * of a name (that's the key), a value string and an optional
43 * type string (no wide chars).
45 class ACE_Export ACE_Remote_Name_Space
: public ACE_Name_Space
48 /// "Do-nothing" constructor.
49 ACE_Remote_Name_Space ();
52 * Specifies the scope of this namespace, opens and memory-maps the
53 * associated file (if accessible) or contacts the dedicated name
54 * server process for NET_LOCAL namespace.
56 ACE_Remote_Name_Space (const ACE_TCHAR
*hostname
, u_short port
);
59 * Specifies the scope of this namespace, opens and memory-maps the
60 * associated file (if accessible) or contacts the dedicated name
61 * server process for NET_LOCAL namespace.
63 int open (const ACE_TCHAR
*servername
, u_short port
);
65 /// destructor, do some cleanup :TBD: last dtor should "compress"
67 ~ACE_Remote_Name_Space ();
69 /// Bind a new name to a naming context (Wide character strings).
70 virtual int bind (const ACE_NS_WString
&name_in
,
71 const ACE_NS_WString
&value_in
,
72 const char *type_in
= "");
75 * Overwrite the value or type of an existing name in a
76 * ACE_Remote_Name_Space or bind a new name to the context, if it
77 * didn't exist yet. (Wide character strings interface).
79 virtual int rebind (const ACE_NS_WString
&name_in
,
80 const ACE_NS_WString
&value_in
,
81 const char *type_in
= "");
83 /// Delete a name from a ACE_Remote_Name_Space (Wide character strings
85 virtual int unbind (const ACE_NS_WString
&name_in
);
87 /// Get value and type of a given name binding (Wide chars). The
88 /// caller is responsible for deleting both @a value_out and @a type_out!
89 virtual int resolve (const ACE_NS_WString
&name_in
,
90 ACE_NS_WString
&value_out
,
93 /// Get a set of names matching a specified pattern (wchars). Matching
94 /// means the names must begin with the pattern string.
95 virtual int list_names (ACE_WSTRING_SET
&set_out
,
96 const ACE_NS_WString
&pattern_in
);
98 /// Get a set of values matching a specified pattern (wchars). Matching
99 /// means the values must begin with the pattern string.
100 virtual int list_values (ACE_WSTRING_SET
&set_out
,
101 const ACE_NS_WString
&pattern_in
);
103 /// Get a set of types matching a specified pattern (wchars). Matching
104 /// means the types must begin with the pattern string.
105 virtual int list_types (ACE_WSTRING_SET
&set_out
,
106 const ACE_NS_WString
&pattern_in
);
109 * Get a set of names matching a specified pattern (wchars). Matching
110 * means the names must begin with the pattern string. Returns the
111 * complete binding associated each pattern match.
113 virtual int list_name_entries (ACE_BINDING_SET
&set
,
114 const ACE_NS_WString
&pattern
);
117 * Get a set of values matching a specified pattern (wchars). Matching
118 * means the values must begin with the pattern string. Returns the
119 * complete binding associated each pattern match.
121 virtual int list_value_entries (ACE_BINDING_SET
&set
,
122 const ACE_NS_WString
&pattern
);
125 * Get a set of types matching a specified pattern (wchars). Matching
126 * means the types must begin with the pattern string. Returns the
127 * complete binding associated each pattern match.
129 virtual int list_type_entries (ACE_BINDING_SET
&set
,
130 const ACE_NS_WString
&pattern
);
132 /// Dump the state of the object.
133 virtual void dump () const;
135 ACE_ALLOC_HOOK_DECLARE
;
138 /// Interface to Name server process for NET_LOCAL namespace.
139 ACE_Name_Proxy ns_proxy_
;
142 ACE_END_VERSIONED_NAMESPACE_DECL
144 #include /**/ "ace/post.h"
146 #endif /* ACE_REMOTE_NAME_SPACE_H */