Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Registry Class Reference

A Name Server implementation. More...

#include <Registry.h>

List of all members.

Public Types

typedef ACE_Unbounded_Set<
Name_Component
Name
 A Name is an ordered collections of components (ids). More...

typedef ACE_Unbounded_Set<
Binding
Binding_List
enum  Binding_Type { INVALID, OBJECT, CONTEXT }
 There are two types of bindings. More...


Static Public Methods

ACE_TString make_string (const Name &name)
 Convert a <name> to a <string>. More...

Name make_name (const ACE_TString &string)
 Convert a <string> to a <name>. More...


Static Public Attributes

const ACE_TCHARSTRING_SEPARATOR = ACE_LIB_TEXT ("\\")
 Separator for components in a name. More...


Detailed Description

A Name Server implementation.

The registry interface is inspired by the interface specified in the CORBA Naming Service Specification. The implementation is done through Win32 <Reg*> functions. Other than providing an OO wrapper for the Win32 <Reg*> functions, ACE_Registry provides an abstraction for iteration over the elements of the Registry.

Definition at line 42 of file Registry.h.


Member Typedef Documentation

typedef ACE_Unbounded_Set<Binding> ACE_Registry::Binding_List
 

Definition at line 115 of file Registry.h.

Referenced by ACE_Registry::Naming_Context::list, ACE_Registry_Name_Space::list_name_entries, and ACE_Registry::Binding_Iterator::next_n.

typedef ACE_Unbounded_Set<Name_Component> ACE_Registry::Name
 

A Name is an ordered collections of components (ids).

Definition at line 60 of file Registry.h.


Member Enumeration Documentation

enum ACE_Registry::Binding_Type
 

There are two types of bindings.

Enumeration values:
INVALID 
OBJECT 
CONTEXT 

Definition at line 72 of file Registry.h.

Referenced by ACE_Registry::Binding::Binding.

00072 {INVALID, OBJECT, CONTEXT};


Member Function Documentation

ACE_Registry::Name ACE_Registry::make_name const ACE_TString   string [static]
 

Convert a <string> to a <name>.

Definition at line 634 of file Registry.cpp.

References ACE_String_Base< char >::find, ACE_Unbounded_Set::insert, ssize_t, STRING_SEPARATOR, ACE_OS_String::strlen, and ACE_String_Base< char >::substr.

Referenced by ACE_Registry::Naming_Context::name, and ACE_Registry::Binding::name.

00635 {
00636   ssize_t new_position = 0;
00637   ssize_t last_position = 0;
00638   Name name;
00639 
00640   // Rememeber: NPOS is -1
00641   while (new_position != ACE_TString::npos)
00642     {
00643       Name_Component component;
00644       // Find the separator
00645       new_position = string.find (ACE_Registry::STRING_SEPARATOR, new_position);
00646       if (new_position != ACE_TString::npos)
00647         // If we have not gone past the end
00648         {
00649           // Get the substring
00650           component.id_ = string.substr (last_position,
00651                                          new_position - last_position);
00652           // Skip past the seperator
00653           new_position +=
00654             ACE_OS_String::strlen (ACE_Registry::STRING_SEPARATOR);
00655         }
00656       else
00657         {
00658           // Get the last substring
00659           component.id_ = string.substr (last_position);
00660         }
00661       // Update positions
00662       last_position = new_position;
00663       // Insert component into name
00664       name.insert (component);
00665     }
00666 
00667   return name;
00668 }

ACE_TString ACE_Registry::make_string const Name   name [static]
 

Convert a <name> to a <string>.

Definition at line 610 of file Registry.cpp.

References ACE_Unbounded_Set::begin, ACE_Unbounded_Set::end, and STRING_SEPARATOR.

Referenced by ACE_Registry::Naming_Context::bind, ACE_Registry::Naming_Context::bind_context, ACE_Registry::Naming_Context::bind_new, ACE_Registry::Naming_Context::bind_new_context, ACE_Registry::Binding::Binding, ACE_Registry::Naming_Context::name, ACE_Registry::Naming_Context::rebind, ACE_Registry::Naming_Context::rebind_context, ACE_Registry::Naming_Context::resolve, ACE_Registry::Naming_Context::resolve_context, ACE_Registry::Naming_Context::unbind, and ACE_Registry::Naming_Context::unbind_context.

00611 {
00612   ACE_TString string;
00613   Name &name = ACE_const_cast (Name &, const_name);
00614 
00615   // Iterator through the components of name
00616   for (Name::iterator iterator = name.begin ();
00617        iterator != name.end ();
00618        iterator++)
00619     {
00620       if (iterator != name.begin ())
00621         // If this is not the first component, we will add separators
00622         string += ACE_Registry::STRING_SEPARATOR;
00623       const Name_Component &component = *iterator;
00624       // Add to string
00625       string += component.id_;
00626     }
00627 
00628   return string;
00629 }


Member Data Documentation

const ACE_TCHAR * ACE_Registry::STRING_SEPARATOR = ACE_LIB_TEXT ("\\") [static]
 

Separator for components in a name.

Definition at line 26 of file Registry.cpp.

Referenced by make_name, make_string, and ACE_Registry_Name_Space::open.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:55:05 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002