TAO_Binary_Search_OpTable Class Reference

Helper class for using binary search operatin lookup strategy in the server skeletons. More...

#include <Operation_Table_Binary_Search.h>

Inheritance diagram for TAO_Binary_Search_OpTable:

Inheritance graph
[legend]
Collaboration diagram for TAO_Binary_Search_OpTable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~TAO_Binary_Search_OpTable (void)
 Do nothing destrctor.
virtual int find (const char *opname, TAO_Skeleton &skelfunc, const unsigned int length=0)
 See the documentation in the base class for details.
virtual int find (const char *opname, TAO_Collocated_Skeleton &skelfunc, TAO::Collocation_Strategy s, const unsigned int length=0)
virtual int bind (const char *opname, const TAO::Operation_Skeletons skel_ptr)

Private Member Functions

virtual const TAO_operation_db_entrylookup (const char *str)=0

Detailed Description

Helper class for using binary search operatin lookup strategy in the server skeletons.

This class declares pure virtual method called 'lookup ()' which will be generated by the GPERF program. This method is used by 'bind ()' and 'find ()' methods. Subclasses will define the lookup method.

Definition at line 39 of file Operation_Table_Binary_Search.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Binary_Search_OpTable::~TAO_Binary_Search_OpTable ( void   )  [virtual]

Do nothing destrctor.

Definition at line 34 of file Operation_Table_Binary_Search.cpp.

00035 {
00036 }


Member Function Documentation

int TAO_Binary_Search_OpTable::bind ( const char *  opname,
const TAO::Operation_Skeletons  skel_ptr 
) [virtual]

Associate the skeleton skel_ptr with an operation named opname. Returns -1 on failure, 0 on success, 1 on duplicate.

Implements TAO_Operation_Table.

Definition at line 85 of file Operation_Table_Binary_Search.cpp.

00087 {
00088   return 0;
00089 }

int TAO_Binary_Search_OpTable::find ( const char *  opname,
TAO_Collocated_Skeleton skelfunc,
TAO::Collocation_Strategy  s,
const unsigned int  length = 0 
) [virtual]

Uses opname to look up the collocated skeleton function and pass it back in skelfunc. Returns non-negative integer on success, or -1 on failure.

Implements TAO_Operation_Table.

Definition at line 58 of file Operation_Table_Binary_Search.cpp.

References ACE_ERROR_RETURN, ACE_FUNCTION_TIMEPROBE, ACE_TEXT(), TAO_operation_db_entry::direct_skel_ptr, LM_ERROR, lookup(), and TAO::TAO_CS_DIRECT_STRATEGY.

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 }

int TAO_Binary_Search_OpTable::find ( const char *  opname,
TAO_Skeleton skelfunc,
const unsigned int  length = 0 
) [virtual]

See the documentation in the base class for details.

Implements TAO_Operation_Table.

Definition at line 39 of file Operation_Table_Binary_Search.cpp.

References ACE_ERROR_RETURN, ACE_FUNCTION_TIMEPROBE, ACE_TEXT(), LM_ERROR, lookup(), and TAO_operation_db_entry::skel_ptr.

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 }

virtual const TAO_operation_db_entry* TAO_Binary_Search_OpTable::lookup ( const char *  str  )  [private, pure virtual]

Method that should defined by the subclasses. GPERF program will generate this routine routines.

Referenced by find().


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