Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / PortableServer / Operation_Table_Perfect_Hash.cpp
blob8588dbbe75f660eb2de7001d115abc158a303e1f
1 #include "tao/PortableServer/Operation_Table_Perfect_Hash.h"
2 #include "tao/Timeprobe.h"
3 #include "ace/Log_Msg.h"
5 #if defined (ACE_ENABLE_TIMEPROBES)
7 static const char *TAO_Operation_Table_Timeprobe_Description[] =
9 "TAO_Perfect_Hash_OpTable::find - start",
10 "TAO_Perfect_Hash_OpTable::find - end",
13 enum
15 // Timeprobe description table start key
16 TAO_PERFECT_HASH_OPTABLE_FIND_START = 606,
17 TAO_PERFECT_HASH_OPTABLE_FIND_END,
20 // Setup Timeprobes
21 ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description,
22 TAO_PERFECT_HASH_OPTABLE_FIND_START);
24 #endif /* ACE_ENABLE_TIMEPROBES */
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 int
29 TAO_Perfect_Hash_OpTable::find (const char *opname,
30 TAO_Skeleton &skelfunc,
31 const unsigned int length)
33 ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START);
35 TAO_operation_db_entry const * const entry = lookup (opname,
36 length);
37 if (entry == 0)
39 skelfunc = 0; // insure that somebody can't call a wrong function!
40 TAOLIB_ERROR_RETURN ((LM_ERROR,
41 ACE_TEXT ("TAO_Perfect_Hash_OpTable:find for ")
42 ACE_TEXT ("operation '%C' (length=%d) failed\n"),
43 opname ? opname : "<null string>", length),
44 -1);
47 // Valid entry. Figure out the skel_ptr.
48 skelfunc = entry->skel_ptr;
50 return 0;
53 int
54 TAO_Perfect_Hash_OpTable::find (const char *opname,
55 TAO_Collocated_Skeleton &skelfunc,
56 TAO::Collocation_Strategy st,
57 const unsigned int length)
59 ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START);
61 TAO_operation_db_entry const * const entry = lookup (opname, length);
62 if (entry == 0)
64 skelfunc = 0; // insure that somebody can't call a wrong function!
65 TAOLIB_ERROR_RETURN ((LM_ERROR,
66 ACE_TEXT ("TAO_Perfect_Hash_OpTable:find for ")
67 ACE_TEXT ("operation '%C' (length=%d) failed\n"),
68 opname ? opname : "<null string>", length),
69 -1);
72 switch (st)
74 case TAO::TAO_CS_DIRECT_STRATEGY:
75 skelfunc = entry->direct_skel_ptr;
76 break;
77 default:
78 return -1;
81 return 0;
84 int
85 TAO_Perfect_Hash_OpTable::bind (const char *, const TAO::Operation_Skeletons)
87 return 0;
90 TAO_END_VERSIONED_NAMESPACE_DECL