IOR_Table_Impl.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file IOR_Table_Impl.h
00006  *
00007  *  $Id: IOR_Table_Impl.h 81429 2008-04-24 18:49:54Z johnnyw $
00008  *
00009  *  @author Carlos O'Ryan (coryan@uci.edu)
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_IOR_TABLE_IMPL_H
00015 #define TAO_IOR_TABLE_IMPL_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/IORTable/IORTable.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "ace/Hash_Map_Manager_T.h"
00026 #include "ace/Null_Mutex.h"
00027 #include "tao/LocalObject.h"
00028 #include "ace/SString.h"
00029 #include "tao/Objref_VarOut_T.h"
00030 
00031 #if defined(_MSC_VER)
00032 #pragma warning(push)
00033 #pragma warning(disable:4250)
00034 #endif /* _MSC_VER */
00035 
00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00037 
00038 class TAO_IOR_Table_Impl;
00039 typedef TAO_IOR_Table_Impl *TAO_IOR_Table_Impl_ptr;
00040 typedef TAO_Objref_Var_T <TAO_IOR_Table_Impl> TAO_IOR_Table_Impl_var;
00041 typedef TAO_Objref_Out_T <TAO_IOR_Table_Impl> TAO_IOR_Table_Impl_out;
00042 
00043 class TAO_IOR_Table_Impl
00044   : public virtual IORTable::Table,
00045     public virtual ::CORBA::LocalObject
00046 {
00047 public:
00048   static TAO_IOR_Table_Impl_ptr
00049   _nil (void)
00050   {
00051     return static_cast<TAO_IOR_Table_Impl_ptr> (0);
00052   }
00053 
00054   /// Constructor
00055   TAO_IOR_Table_Impl (void);
00056 
00057   /// Find the object, using the locator if it is not on the table.
00058   char *find (const char *object_key);
00059 
00060   /**
00061    * @name The IORTable::Table methods
00062    *
00063    * Please check the IORTable.pidl file for details.
00064    */
00065   //@{
00066   virtual void bind (const char * object_key, const char * IOR);
00067 
00068   virtual void rebind (const char * object_key, const char * IOR);
00069 
00070   virtual void unbind (const char * object_key);
00071 
00072   virtual void set_locator (IORTable::Locator_ptr the_locator);
00073   //@}
00074 
00075 private:
00076   typedef ACE_Hash_Map_Manager_Ex <ACE_CString, ACE_CString,
00077                                    ACE_Hash <ACE_CString>,
00078                                    ACE_Equal_To <ACE_CString>,
00079                                    ACE_Null_Mutex> Map;
00080 
00081   /// The map
00082   Map map_;
00083 
00084   /// The locator
00085   IORTable::Locator_var locator_;
00086 
00087   /// Synchronization
00088   TAO_SYNCH_MUTEX lock_;
00089 };
00090 
00091 // Traits specializations.
00092 namespace TAO
00093 {
00094   template<>
00095   struct TAO_IORTable_Export
00096   Objref_Traits <TAO_IOR_Table_Impl>
00097   {
00098     static TAO_IOR_Table_Impl_ptr duplicate (TAO_IOR_Table_Impl_ptr);
00099 
00100     static void release (TAO_IOR_Table_Impl_ptr);
00101 
00102     static TAO_IOR_Table_Impl_ptr nil (void);
00103 
00104     static ::CORBA::Boolean marshal (const TAO_IOR_Table_Impl_ptr p,
00105                                      TAO_OutputCDR &cdr);
00106   }
00107   ;
00108 }
00109 
00110 
00111 TAO_END_VERSIONED_NAMESPACE_DECL
00112 
00113 #if defined(_MSC_VER)
00114 #pragma warning(pop)
00115 #endif /* _MSC_VER */
00116 
00117 #include /**/ "ace/post.h"
00118 
00119 #endif /* TAO_IOR_TABLE_IMPL */

Generated on Tue Feb 2 17:43:41 2010 for TAO_IORTable by  doxygen 1.4.7