3 //=============================================================================
5 * @file Operation_Table_Perfect_Hash.h
7 * @author Aniruddha Gokhale
9 //=============================================================================
11 #ifndef TAO_OPERATION_TABLE_PERFECT_HASH_H
12 #define TAO_OPERATION_TABLE_PERFECT_HASH_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PortableServer/portableserver_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/PortableServer/Operation_Table.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 * @class TAO_Perfect_Hash_OpTable
29 * @brief Helper class for use of perfect hashing operation lookup
32 * This class declares pure virtual methods called 'lookup ()'
33 * and 'hash ()' which will be generated by the GPERF
34 * program. These methods are used by 'bind ()' and 'find ()'
35 * methods. Subclasses will define the lookup and hash
38 class TAO_PortableServer_Export TAO_Perfect_Hash_OpTable
39 : public TAO_Operation_Table
42 /// Do nothing destructor.
43 ~TAO_Perfect_Hash_OpTable () override
= default;
45 /// See the documentation in the base class for details.
46 int find (const char *opname
,
47 TAO_Skeleton
&skelfunc
,
48 const unsigned int length
= 0) override
;
50 int find (const char *opname
,
51 TAO_Collocated_Skeleton
&skelfunc
,
52 TAO::Collocation_Strategy s
,
53 const unsigned int length
= 0) override
;
55 int bind (const char *opname
,
56 const TAO::Operation_Skeletons skel_ptr
) override
;
59 // = Methods that should defined by the subclasses. GPERF program
60 // will generate these routines.
61 virtual unsigned int hash (const char *str
, unsigned int len
) = 0;
63 virtual const TAO_operation_db_entry
* lookup (const char *str
, unsigned int len
) = 0;
66 TAO_END_VERSIONED_NAMESPACE_DECL
68 #include /**/ "ace/post.h"
69 #endif /* TAO_OPERATION_TABLE_PERFECT_HASH_H */