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

Remote_Name_Space.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    Remote_Name_Space.h
00006  *
00007  *  $Id: Remote_Name_Space.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Prashant Jain
00010  */
00011 //==========================================================================
00012 
00013 
00014 #ifndef ACE_REMOTE_NAME_SPACE_H
00015 #define ACE_REMOTE_NAME_SPACE_H
00016 
00017 #include "ace/pre.h"
00018 
00019 #include "ace/ACE_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "ace/SString.h"
00026 #include "ace/Name_Proxy.h"
00027 #include "ace/Name_Space.h"
00028 
00029 typedef ACE_Unbounded_Set<ACE_NS_WString> ACE_WSTRING_SET;
00030 
00031 /**
00032  * @class ACE_Remote_Name_Space
00033  *
00034  * @brief Maintaining accesses Remote Name Server Database.  Allows to
00035  * add NameBindings, change them, remove them and resolve
00036  * NameBindings.
00037  *
00038  * Manages a Naming Service for a remote name space which
00039  * includes bindings for net_local naming context.  All strings
00040  * are stored in wide character format.  A Name Binding consists
00041  * of a name (that's the key), a value string and an optional
00042  * type string (no wide chars).
00043  */
00044 class ACE_Export ACE_Remote_Name_Space : public ACE_Name_Space
00045 {
00046 public:
00047   // = Initialization and termination methods.
00048   /// "Do-nothing" constructor.
00049   ACE_Remote_Name_Space (void);
00050 
00051   /**
00052    * Specifies the scope of this namespace, opens and memory-maps the
00053    * associated file (if accessible) or contacts the dedicated name
00054    * server process for NET_LOCAL namespace.
00055    */
00056   ACE_Remote_Name_Space (const ACE_TCHAR *hostname, u_short port);
00057 
00058   /**
00059    * Specifies the scope of this namespace, opens and memory-maps the
00060    * associated file (if accessible) or contacts the dedicated name
00061    * server process for NET_LOCAL namespace.
00062    */
00063   int open (const ACE_TCHAR *servername, u_short port);
00064 
00065   /// destructor, do some cleanup :TBD: last dtor should "compress"
00066   /// file
00067   ~ACE_Remote_Name_Space (void);
00068 
00069   /// Bind a new name to a naming context (Wide character strings).
00070   virtual int bind (const ACE_NS_WString &name_in,
00071                     const ACE_NS_WString &value_in,
00072                     const char *type_in = "");
00073 
00074   /**
00075    * Overwrite the value or type of an existing name in a
00076    * ACE_Remote_Name_Space or bind a new name to the context, if it
00077    * didn't exist yet. (Wide charcter strings interface).
00078    */
00079   virtual int rebind (const ACE_NS_WString &name_in,
00080                       const ACE_NS_WString &value_in,
00081                       const char *type_in = "");
00082 
00083   /// Delete a name from a ACE_Remote_Name_Space (Wide charcter strings
00084   /// Interface).
00085   virtual int unbind (const ACE_NS_WString &name_in);
00086 
00087   /// Get value and type of a given name binding (Wide chars).  The
00088   /// caller is responsible for deleting both <value_out> and <type_out>!
00089   virtual int resolve (const ACE_NS_WString &name_in,
00090                        ACE_NS_WString &value_out,
00091                        char *&type_out);
00092 
00093   /// Get a set of names matching a specified pattern (wchars). Matching
00094   /// means the names must begin with the pattern string.
00095   virtual int list_names (ACE_WSTRING_SET &set_out,
00096                           const ACE_NS_WString &pattern_in);
00097 
00098   /// Get a set of values matching a specified pattern (wchars). Matching
00099   /// means the values must begin with the pattern string.
00100   virtual int list_values (ACE_WSTRING_SET &set_out,
00101                            const ACE_NS_WString &pattern_in);
00102 
00103   /// Get a set of types matching a specified pattern (wchars). Matching
00104   /// means the types must begin with the pattern string.
00105   virtual int list_types (ACE_WSTRING_SET &set_out,
00106                           const ACE_NS_WString &pattern_in);
00107 
00108   /**
00109    * Get a set of names matching a specified pattern (wchars). Matching
00110    * means the names must begin with the pattern string. Returns the
00111    * complete binding associated each pattern match.
00112    */
00113   virtual int list_name_entries (ACE_BINDING_SET &set,
00114                                  const ACE_NS_WString &pattern);
00115 
00116   /**
00117    * Get a set of values matching a specified pattern (wchars). Matching
00118    * means the values must begin with the pattern string. Returns the
00119    * complete binding associated each pattern match.
00120    */
00121   virtual int list_value_entries (ACE_BINDING_SET &set,
00122                                   const ACE_NS_WString &pattern);
00123 
00124   /**
00125    * Get a set of types matching a specified pattern (wchars). Matching
00126    * means the types must begin with the pattern string. Returns the
00127    * complete binding associated each pattern match.
00128    */
00129   virtual int list_type_entries (ACE_BINDING_SET &set,
00130                                  const ACE_NS_WString &pattern);
00131 
00132   /// Dump the state of the object.
00133   virtual void dump (void) const;
00134 
00135 private:
00136   /// Interface to Name server process for NET_LOCAL namespace.
00137   ACE_Name_Proxy ns_proxy_;
00138 };
00139 
00140 #include "ace/post.h"
00141 
00142 #endif /* ACE_REMOTE_NAME_SPACE_H */

Generated on Mon Jun 16 11:21:04 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002