diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-04-13 14:47:50 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-04-13 14:47:50 +0000 |
commit | feb8e89d1f3932917e3068c9c23db15ce55286e4 (patch) | |
tree | 0d62c61c2e4151b7665392d162436ee7d1e6782d /TAO/CIAO/ciao/Server_init.h | |
parent | cbe8aa5d5be1d4679ae0c4e30baaea24fbae416c (diff) | |
download | ATCD-feb8e89d1f3932917e3068c9c23db15ce55286e4.tar.gz |
Thu Apr 13 13:43:19 UTC 2006 William R. Otte <wotte@dre.vanderbilt.edu>escher_x_4_9_integration_point
Diffstat (limited to 'TAO/CIAO/ciao/Server_init.h')
-rw-r--r-- | TAO/CIAO/ciao/Server_init.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/TAO/CIAO/ciao/Server_init.h b/TAO/CIAO/ciao/Server_init.h index 728c4abdd10..c5fe53ed77d 100644 --- a/TAO/CIAO/ciao/Server_init.h +++ b/TAO/CIAO/ciao/Server_init.h @@ -7,6 +7,7 @@ * I'm also puting some utilities functions here. * * @author Nanbor Wang <nanbor@cs.wustl.edu> + * @author Gan Deng <dengg@dre.vanderbilt.edu> */ #ifndef CIAO_SERVER_INIT_H @@ -15,6 +16,7 @@ #include "CIAO_Server_Export.h" #include "tao/Versioned_Namespace.h" +#include <orbsvcs/CosNamingC.h> #if !defined ACE_LACKS_PRAGMA_ONCE #pragma once @@ -46,6 +48,42 @@ namespace CIAO /// overwritten. CIAO_SERVER_Export int write_IOR (const char *pathname, const char *IOR); + + class CIAO_SERVER_Export NameUtility + { + /** + * A utility class to bind naming context. This class is contributed by + * Dipa Suri <dipa.suri@lmco.com>. + * + * The concept/code are derived from + * http://www.informit.com/articles/article.asp?p=23266&seqNum=6 + */ + + public: + /// For each 'NameComponent' in 'name', create a corresponding 'NamingContext'. + static void CreateContextPath (const CosNaming::NamingContextExt_ptr, + const CosNaming::Name &); + + /// For the first [0, length-2] NameComponents of 'name', create a + /// corresponding 'NamingContext'. + /// For the length-1 NameComponent of 'name', bind it to the object + /// reference 'obj'. + static void BindObjectPath (const CosNaming::NamingContextExt_ptr, + const CosNaming::Name&, + const CORBA::Object_var); + + /// Get a list of all bindings under the given context, up to + /// max_list_size. + static CosNaming::BindingList * listBindings (const CosNaming::NamingContext_ptr, + const CosNaming::Name&, + CORBA::ULong); + + /// Recursively unbind all objects and contexts below the given name + /// context, given the initial context nc. + /// Assumes a tree shape to service (not cyclic) + static void recursiveUnbind (const CosNaming::NamingContext_ptr, + const CosNaming::Name&); + }; } } |