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).

typedef ACE_Unbounded_Set<
Binding
Binding_List
 A list of bindings.

enum  Binding_Type { INVALID, OBJECT, CONTEXT }
 There are two types of bindings. More...


Static Public Member Functions

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

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


Static Public Attributes

const ACE_TCHAR STRING_SEPARATOR [] = ACE_LIB_TEXT ("\\")
 Separator for components in a name.


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 44 of file Registry.h.


Member Typedef Documentation

typedef ACE_Unbounded_Set<Binding> ACE_Registry::Binding_List
 

A list of bindings.

Definition at line 117 of file Registry.h.

Referenced by ACE_Registry::Naming_Context::list(), ACE_Registry_Name_Space::list_name_entries(), ACE_Registry::Binding_Iterator::Iteration_Complete::next_n(), ACE_Registry::Binding_Iterator::Context_Iteration::next_n(), ACE_Registry::Binding_Iterator::Object_Iteration::next_n(), ACE_Registry::Binding_Iterator::next_n(), and ACE_Registry::Binding_Iterator::next_one().

typedef ACE_Unbounded_Set<Name_Component> ACE_Registry::Name
 

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

Definition at line 62 of file Registry.h.

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(), make_name(), make_string(), ACE_Registry::Naming_Context::name(), ACE_Registry::Binding::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().


Member Enumeration Documentation

enum ACE_Registry::Binding_Type
 

There are two types of bindings.

Enumeration values:
INVALID 
OBJECT 
CONTEXT 

Definition at line 74 of file Registry.h.

00074 {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 638 of file Registry.cpp.

References ACE_TString, ACE_String_Base< CHAR >::find(), ACE_Registry::Name_Component::id_, ACE_Unbounded_Set< T >::insert(), Name, ssize_t, STRING_SEPARATOR, ACE_OS::strlen(), and ACE_String_Base< CHAR >::substr().

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

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

ACE_TString ACE_Registry::make_string const Name name  )  [static]
 

Convert a name to a string.

Definition at line 614 of file Registry.cpp.

References ACE_TString, ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), ACE_Registry::Name_Component::id_, Name, 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().

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


Member Data Documentation

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

Separator for components in a name.

Definition at line 30 of file Registry.cpp.

Referenced by make_name(), and make_string().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:27:56 2006 for ACE by doxygen 1.3.6