summaryrefslogtreecommitdiff
path: root/ace/Registry_Name_Space.h
blob: 81bf2431cc5eb05b96f3b432570779d9924585a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*-*- C++ -*- */

// ============================================================================
//
// = LIBRARY
//    ACE
// 
// = FILENAME
//    ACE_Registry_Name_Space
//
// = AUTHOR
//    Irfan Pyarali (irfan@cs.wustl.edu)
//
// ============================================================================

#if !defined (ACE_REGISTRY_NAME_SPACE_H)
#define ACE_REGISTRY_NAME_SPACE_H

#if (defined (ACE_WIN32) && (defined (UNICODE)))
// This only works on Win32 platforms when UNICODE is turned on

#include "ace/Registry.h"
#include "ace/Naming_Context.h"
#include "ace/Name_Space.h"

class ACE_Export ACE_Registry_Name_Space : public ACE_Name_Space
// = TITLE
//
// = DESCRIPTION
//
{
public:

  ACE_Registry_Name_Space (void);
  // Constructor

  ACE_Registry_Name_Space (ACE_Name_Options *name_options);
  // Contacts and opens the registry on the specified server 

  ~ACE_Registry_Name_Space (void);
  // Destructor

  int open (ACE_Name_Options *name_options);
  // Contacts and opens the registry on the specified server 

  int bind (const ACE_WString &name_in, 
	    const ACE_WString &value_in, 
	    const char *type_in = "");
  // Bind a new name to a naming context (Wide character strings).

  int rebind (const ACE_WString &name_in, 
	      const ACE_WString &value_in, 
	      const char *type_in = "");
  // Overwrite the value or type of an existing name in a
  // ACE_Name_Space or bind a new name to the context, if it didn't
  // exist yet. (Wide charcter strings interface).

  int unbind (const ACE_WString &name_in);
  // Delete a name from a ACE_Name_Space (Wide charcter strings
  // Interface).

  int resolve (const ACE_WString &name_in, 
	       ACE_WString &value_out, 
	       char *&type_out);
  // Get value and type of a given name binding (Wide chars).  The
  // caller is responsible for deleting both <value_out> and <type_out>!
  
  int list_names (ACE_WSTRING_SET &set_out, 
		  const ACE_WString &pattern_in);
  // Get a set of names matching a specified pattern (wchars). Matching
  // means the names must begin with the pattern string.

  int list_values (ACE_WSTRING_SET &set_out, 
		   const ACE_WString &pattern_in);
  // Get a set of values matching a specified pattern (wchars). Matching
  // means the values must begin with the pattern string.

  int list_types (ACE_WSTRING_SET &set_out, 
		  const ACE_WString &pattern_in);
  // Get a set of types matching a specified pattern (wchars). Matching
  // means the types must begin with the pattern string.

  int list_name_entries (ACE_BINDING_SET &set, 
			 const ACE_WString &pattern);
  // Get a set of names matching a specified pattern (wchars). Matching
  // means the names must begin with the pattern string. Returns the
  // complete binding associated each pattern match.

  int list_value_entries (ACE_BINDING_SET &set, 
			  const ACE_WString &pattern);
  // Get a set of values matching a specified pattern (wchars). Matching
  // means the values must begin with the pattern string. Returns the
  // complete binding associated each pattern match.

  int list_type_entries (ACE_BINDING_SET &set, 
			 const ACE_WString &pattern);
  // Get a set of types matching a specified pattern (wchars). Matching
  // means the types must begin with the pattern string. Returns the
  // complete binding associated each pattern match.

  void dump (void) const;
  // Dump the state of the object

private:

  ACE_Registry::Naming_Context context_;
  // current context
};

#endif /* ACE_WIN32 && UNICODE */
#endif /* ACE_REGISTRY_NAME_SPACE_H */