Operation_Table_Dynamic_Hash.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Operation_Table_Dynamic_Hash.h
00006  *
00007  *  $Id: Operation_Table_Dynamic_Hash.h 71473 2006-03-10 07:19:20Z jtc $
00008  *
00009  *  @author Aniruddha Gokhale
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_OPERATION_TABLE_DYNAMIC_HASH_H
00014 #define TAO_OPERATION_TABLE_DYNAMIC_HASH_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/PortableServer/portableserver_export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/PortableServer/Operation_Table.h"
00025 #include "ace/Hash_Map_Manager.h"
00026 #include "ace/Synch_Traits.h"
00027 #include "ace/Null_Mutex.h"
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 /**
00032  * @class TAO_Dynamic_Hash_OpTable
00033  *
00034  * @brief Dynamic Hashing scheme for CORBA IDL operation name lookup.
00035  */
00036 class TAO_PortableServer_Export TAO_Dynamic_Hash_OpTable
00037   : public TAO_Operation_Table
00038 {
00039 public:
00040   // = Initialization and termination methods.
00041   /**
00042    * Initialize the dynamic hash operation table with a database of
00043    * operation names. The hash table size may be different from the
00044    * size of the database. Hence we use the third argument to specify
00045    * the size of the internal hash table.  The <alloc> argument is
00046    * used to determine where the memory comes from (usually from
00047    * <ACE_Static_Allocator_Base>).
00048    */
00049   TAO_Dynamic_Hash_OpTable (const TAO_operation_db_entry *db,
00050                             CORBA::ULong dbsize,
00051                             CORBA::ULong hashtblsize,
00052                             ACE_Allocator *alloc);
00053 
00054   /// Destructor
00055   ~TAO_Dynamic_Hash_OpTable (void);
00056 
00057   /// See the documentation in the base class for details.
00058   virtual int bind (const char *opname,
00059                     const TAO::Operation_Skeletons skel_ptr);
00060 
00061   virtual int find (const char *opname,
00062                     TAO_Skeleton &skelfunc,
00063                     const unsigned int length = 0);
00064 
00065   virtual int find (const char *opname,
00066                     TAO_Collocated_Skeleton &skelfunc,
00067                     TAO::Collocation_Strategy s,
00068                     const unsigned int length = 0);
00069 private:
00070   typedef ACE_Hash_Map_Manager_Ex<const char *,
00071                                   TAO::Operation_Skeletons,
00072                                   ACE_Hash<const char *>,
00073                                   ACE_Equal_To<const char *>,
00074                                   ACE_Null_Mutex>
00075         OP_MAP_MANAGER;
00076 
00077   /// The hash table data structure.
00078   OP_MAP_MANAGER hash_;
00079 };
00080 
00081 TAO_END_VERSIONED_NAMESPACE_DECL
00082 
00083 #include /**/ "ace/post.h"
00084 #endif /* TAO_OPERATION_TABLE_DYNAMIC_HASH_H */

Generated on Tue Feb 2 17:40:54 2010 for TAO_PortableServer by  doxygen 1.4.7