TAO_CORBA_Policy_Perfect_Hash_OpTable Class Reference

Inheritance diagram for TAO_CORBA_Policy_Perfect_Hash_OpTable:

Inheritance graph
[legend]
Collaboration diagram for TAO_CORBA_Policy_Perfect_Hash_OpTable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const TAO_operation_db_entrylookup (const char *str, unsigned int len)

Private Member Functions

unsigned int hash (const char *str, unsigned int len)

Detailed Description

Definition at line 124 of file PolicyS.cpp.


Member Function Documentation

unsigned int TAO_CORBA_Policy_Perfect_Hash_OpTable::hash ( const char *  str,
unsigned int  len 
) [private, virtual]

Implements TAO_Perfect_Hash_OpTable.

Definition at line 137 of file PolicyS.cpp.

Referenced by lookup().

00138 {
00139   static const unsigned char asso_values[] =
00140     {
00141 #if defined (ACE_MVS)
00142      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00143      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00144      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00145      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00146      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00147      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00148      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00149      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00150      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00151      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00152      22, 22, 22, 22, 22, 22, 22, 22, 22,  0,
00153      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00154      22, 22, 22, 22, 22, 22, 22, 22, 22,  0,
00155      22,  0,  0,  5, 22, 22, 22, 22, 22, 22,
00156      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00157      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00158      22, 22, 22,  0, 22, 22, 22, 22,  0, 22,
00159      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00160      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00161      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00162      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00163      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00164      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00165      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00166      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00167      22, 22, 22, 22, 22, 22,
00168 #else
00169      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00170      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00171      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00172      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00173      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00174      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00175      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00176      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00177      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00178      22, 22, 22, 22, 22,  0, 22,  0, 22,  0,
00179       0,  5, 22, 22, 22, 22, 22, 22, 22, 22,
00180      22, 22, 22, 22, 22, 22,  0, 22, 22, 22,
00181      22,  0, 22, 22, 22, 22, 22, 22,
00182 #endif /* ACE_MVS */
00183     };
00184   return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
00185 }

const TAO_operation_db_entry * TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup ( const char *  str,
unsigned int  len 
) [virtual]

Implements TAO_Perfect_Hash_OpTable.

Definition at line 188 of file PolicyS.cpp.

References POA_CORBA::Policy::_component_skel(), POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type(), POA_CORBA::Policy::_get_policy_type_skel(), POA_CORBA::Policy::_interface_skel(), POA_CORBA::Policy::_is_a_skel(), POA_CORBA::Policy::_non_existent_skel(), POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy(), POA_CORBA::Policy::copy_skel(), POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy(), POA_CORBA::Policy::destroy_skel(), hash(), TAO_operation_db_entry::opname, and strncmp().

00189 {
00190   enum
00191     {
00192       TOTAL_KEYWORDS = 7,
00193       MIN_WORD_LENGTH = 4,
00194       MAX_WORD_LENGTH = 16,
00195       MIN_HASH_VALUE = 4,
00196       MAX_HASH_VALUE = 21,
00197       HASH_VALUE_RANGE = 18,
00198       DUPLICATES = 0,
00199       WORDLIST_SIZE = 11
00200     };
00201 
00202   static const TAO_operation_db_entry  wordlist[] =
00203     {
00204       {"",0,0},{"",0,0},{"",0,0},{"",0,0},
00205       {"copy", &POA_CORBA::Policy::copy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy},
00206       {"_is_a", &POA_CORBA::Policy::_is_a_skel, 0},
00207       {"",0,0},
00208       {"destroy", &POA_CORBA::Policy::destroy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy},
00209       {"",0,0},{"",0,0},
00210       {"_component", &POA_CORBA::Policy::_component_skel, 0},
00211       {"",0,0},{"",0,0},
00212       {"_non_existent", &POA_CORBA::Policy::_non_existent_skel, 0},
00213       {"",0,0},
00214       {"_interface", &POA_CORBA::Policy::_interface_skel, 0},
00215       {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
00216       {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type},
00217     };
00218 
00219   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
00220     {
00221       unsigned int key = hash (str, len);
00222 
00223       if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
00224         {
00225           const char *s = wordlist[key].opname;
00226 
00227           if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
00228             return &wordlist[key];
00229         }
00230     }
00231   return 0;
00232 }


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 17:41:28 2010 for TAO_PortableServer by  doxygen 1.4.7