Public Member Functions | Private Member Functions

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.

{
  static const unsigned char asso_values[] =
    {
#if defined (ACE_MVS)
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22,  0,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22,  0,
     22,  0,  0,  5, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22,  0, 22, 22, 22, 22,  0, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22,
#else
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22,  0, 22,  0, 22,  0,
      0,  5, 22, 22, 22, 22, 22, 22, 22, 22,
     22, 22, 22, 22, 22, 22,  0, 22, 22, 22,
     22,  0, 22, 22, 22, 22, 22, 22,
#endif /* ACE_MVS */
    };
  return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
}

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.

{
  enum
    {
      TOTAL_KEYWORDS = 7,
      MIN_WORD_LENGTH = 4,
      MAX_WORD_LENGTH = 16,
      MIN_HASH_VALUE = 4,
      MAX_HASH_VALUE = 21,
      HASH_VALUE_RANGE = 18,
      DUPLICATES = 0,
      WORDLIST_SIZE = 11
    };

  static const TAO_operation_db_entry  wordlist[] =
    {
      {"",0,0},{"",0,0},{"",0,0},{"",0,0},
      {"copy", &POA_CORBA::Policy::copy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy},
      {"_is_a", &POA_CORBA::Policy::_is_a_skel, 0},
      {"",0,0},
      {"destroy", &POA_CORBA::Policy::destroy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy},
      {"",0,0},{"",0,0},
      {"_component", &POA_CORBA::Policy::_component_skel, 0},
      {"",0,0},{"",0,0},
      {"_non_existent", &POA_CORBA::Policy::_non_existent_skel, 0},
      {"",0,0},
      {"_interface", &POA_CORBA::Policy::_interface_skel, 0},
      {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
      {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type},
    };

  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
    {
      unsigned int key = hash (str, len);

      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
        {
          const char *s = wordlist[key].opname;

          if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
            return &wordlist[key];
        }
    }
  return 0;
}


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines