Naming_Client.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Naming_Client.h
00006  *
00007  *  $Id: Naming_Client.h 76880 2007-02-02 16:22:17Z johnnyw $
00008  *
00009  *    Implement wrappers useful to Naming Service clients.
00010  *
00011  *
00012  *  @author Nagarajan Surendran (naga@cs.wustl.edu)
00013  *  @author Matt Braun <mjb2@cs.wustl.edu>
00014  *  @author and Douglas C. Schmidt <schmidt@cs.wustl.edu>.
00015  */
00016 //=============================================================================
00017 
00018 
00019 #ifndef TAO_NAMING_CLIENT_H
00020 #define TAO_NAMING_CLIENT_H
00021 #include /**/ "ace/pre.h"
00022 
00023 #include "tao/ORB.h"
00024 #include "orbsvcs/CosNamingC.h"
00025 #include "orbsvcs/Naming/naming_export.h"
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 /**
00030  * @class TAO_Naming_Client
00031  *
00032  * @brief This class is intended to simplify programs that want to play
00033  * the role of Naming Service clients.
00034  *
00035  * Wrapper class that locates the root Naming Context.  It also
00036  * defines the operator-> so that <NamingContext> functions like
00037  * <resolve>, etc. can be directly called on a
00038  * <TAO_Naming_Client> object, and will be forwarded to the root
00039  * Naming Context.
00040  */
00041 class TAO_Naming_Export TAO_Naming_Client
00042 {
00043 public:
00044   // = Initialization and termination methods.
00045 
00046   /// Default constructor.
00047   TAO_Naming_Client (void);
00048 
00049   /**
00050    * Look for a Naming Service for a period of @a timeout using
00051    * @c resolve_initial_references.  Return 0 if Naming Service is
00052    * successfully located, and -1 on failure.
00053    */
00054   int init (CORBA::ORB_ptr orb, ACE_Time_Value *timeout = 0);
00055 
00056   /// Destructor.
00057   ~TAO_Naming_Client (void);
00058 
00059   /// Returns a pointer to the root Naming Context.
00060   CosNaming::NamingContext_ptr operator-> (void) const;
00061 
00062   /**
00063    * Returns a pointer to the root Naming Context.  This ptr is
00064    * duplicated via <_duplicate> so that it can be stored into a
00065    * <*_var>.
00066    */
00067   CosNaming::NamingContext_ptr get_context (void) const;
00068 
00069 protected:
00070   /// Reference to the root Naming Context.
00071   CosNaming::NamingContext_var naming_context_;
00072 };
00073 
00074 TAO_END_VERSIONED_NAMESPACE_DECL
00075 
00076 #include /**/ "ace/post.h"
00077 #endif /* TAO_NAMING_CLIENT_H */

Generated on Sun Jan 27 16:15:29 2008 for TAO_CosNaming by doxygen 1.3.6