Operation_Table_Binary_Search.cpp

Go to the documentation of this file.
00001 // $Id: Operation_Table_Binary_Search.cpp 71473 2006-03-10 07:19:20Z jtc $
00002 
00003 #include "tao/PortableServer/Operation_Table_Binary_Search.h"
00004 #include "tao/Timeprobe.h"
00005 #include "ace/Log_Msg.h"
00006 
00007 ACE_RCSID(PortableServer,
00008           Operation_Table_Binary_Search,
00009           "$Id: Operation_Table_Binary_Search.cpp 71473 2006-03-10 07:19:20Z jtc $")
00010 
00011 #if defined (ACE_ENABLE_TIMEPROBES)
00012 
00013 static const char *TAO_Operation_Table_Timeprobe_Description[] =
00014   {
00015     "TAO_Binary_Search_OpTable::find - start",
00016     "TAO_Binary_Search_OpTable::find - end"
00017   };
00018 
00019 enum
00020   {
00021     // Timeprobe description table start key
00022     TAO_BINARY_SEARCH_OPTABLE_FIND_START = 608,
00023     TAO_BINARY_SEARCH_OPTABLE_FIND_END
00024   };
00025 
00026 // Setup Timeprobes
00027 ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description,
00028                                   TAO_BINARY_SEARCH_OPTABLE_FIND_START);
00029 
00030 #endif /* ACE_ENABLE_TIMEPROBES */
00031 
00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00033 
00034 TAO_Binary_Search_OpTable::~TAO_Binary_Search_OpTable (void)
00035 {
00036 }
00037 
00038 int
00039 TAO_Binary_Search_OpTable::find (const char *opname,
00040                                  TAO_Skeleton &skelfunc,
00041                                  const unsigned int /* length */)
00042 {
00043   ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START);
00044 
00045   TAO_operation_db_entry const * const entry = lookup (opname);
00046 
00047   if (entry == 0)
00048     ACE_ERROR_RETURN ((LM_ERROR,
00049                        ACE_TEXT ("TAO_Binary_Search_Table:find failed\n")),
00050                       -1);
00051   // Valid entry. Figure out the skel_ptr.
00052   skelfunc = entry->skel_ptr;
00053 
00054   return 0;
00055 }
00056 
00057 int
00058 TAO_Binary_Search_OpTable::find (const char *opname,
00059                                  TAO_Collocated_Skeleton &skelfunc,
00060                                  TAO::Collocation_Strategy st,
00061                                  const unsigned int /* length */)
00062 {
00063   ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START);
00064 
00065   TAO_operation_db_entry const * const entry = lookup (opname);
00066 
00067   if (entry == 0)
00068     ACE_ERROR_RETURN ((LM_ERROR,
00069                        ACE_TEXT ("TAO_Binary_Search_Table:find failed\n")),
00070                       -1);
00071 
00072   switch (st)
00073     {
00074     case TAO::TAO_CS_DIRECT_STRATEGY:
00075       skelfunc = entry->direct_skel_ptr;
00076       break;
00077     default:
00078       return -1;
00079     }
00080 
00081   return 0;
00082 }
00083 
00084 int
00085 TAO_Binary_Search_OpTable::bind (const char *,
00086                                  const TAO::Operation_Skeletons)
00087 {
00088   return 0;
00089 }
00090 
00091 TAO_END_VERSIONED_NAMESPACE_DECL

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