Operation_Table.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Operation_Table.h
00006  *
00007  *  Operation_Table.h,v 1.14 2006/03/10 07:19:13 jtc Exp
00008  *
00009  *  @author Aniruddha Gokhale
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_OPTABLE_H
00014 #define TAO_OPTABLE_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/PortableServer/portableserver_export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/Object.h"
00025 #include "tao/Collocation_Strategy.h"
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 class TAO_ServerRequest;
00030 class TAO_Abstract_ServantBase;
00031 
00032 namespace CORBA
00033 {
00034   class Environment;
00035 }
00036 
00037 typedef void (*TAO_Skeleton)(
00038     TAO_ServerRequest &,
00039     void *,
00040     void *
00041 #if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT)
00042     , CORBA::Environment &
00043 #endif
00044   );
00045 
00046 typedef void (*TAO_Collocated_Skeleton)(
00047     TAO_Abstract_ServantBase *,
00048     TAO::Argument **,
00049     int
00050 #if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT)
00051     , CORBA::Environment &
00052 #endif
00053   );
00054 
00055 /**
00056  * @struct TAO_operation_db_entry
00057  *
00058  * @brief Define a table entry that holds an operation name and its
00059  * corresponding skeleton.  A table of such entries is used to
00060  * initialize the different lookup strategies.
00061  */
00062 struct TAO_operation_db_entry
00063 {
00064   /// Operation name
00065   char const * opname;
00066 
00067   /// Remote/thru-POA skeleton pointer
00068   TAO_Skeleton skel_ptr;
00069 
00070   /// Collocated skeleton pointers.
00071   TAO_Collocated_Skeleton direct_skel_ptr;
00072 };
00073 
00074 // --------------------------
00075 
00076 namespace TAO
00077 {
00078   /**
00079    * @class Operation_Skeleton_Ptr
00080    *
00081    * @brief A logical aggregation of all the operation skeleton pointers
00082    * in use.
00083    *
00084    * This is not used by the IDL compiler. This is used internally
00085    * within different strategies.
00086    */
00087   struct Operation_Skeletons
00088   {
00089     Operation_Skeletons (void);
00090 
00091     /// Remote skeleton pointer
00092     TAO_Skeleton skel_ptr;
00093 
00094     /// Collocated skeleton pointers.
00095     TAO_Skeleton thruPOA_skel_ptr;
00096     TAO_Collocated_Skeleton direct_skel_ptr;
00097   };
00098 }
00099 
00100 /**
00101  * @class TAO_Operation_Table
00102  *
00103  * @brief Abstract class for maintaining and lookup of CORBA IDL
00104  * operation names.
00105  */
00106 class TAO_PortableServer_Export TAO_Operation_Table
00107 {
00108 public:
00109   /**
00110    * Uses @a opname to look up the skeleton function and pass it back
00111    * in @a skelfunc.  Returns non-negative integer on success, or -1
00112    * on failure.
00113    */
00114   virtual int find (const char *opname,
00115                     TAO_Skeleton &skelfunc,
00116                     const unsigned int length = 0) = 0;
00117 
00118   /**
00119    * Uses @a opname to look up the collocated skeleton function and
00120    * pass it back in @a skelfunc.  Returns non-negative integer on
00121    * success, or -1 on failure.
00122    */
00123   virtual int find (const char *opname,
00124                     TAO_Collocated_Skeleton &skelfunc,
00125                     TAO::Collocation_Strategy s,
00126                     const unsigned int length = 0) = 0;
00127 
00128   /// Associate the skeleton @a skel_ptr with an operation named
00129   /// @a opname.  Returns -1 on failure, 0 on success, 1 on duplicate.
00130   virtual int bind (const char *opname,
00131                     const TAO::Operation_Skeletons skel_ptr) = 0;
00132 
00133   virtual ~TAO_Operation_Table (void);
00134 };
00135 
00136 TAO_END_VERSIONED_NAMESPACE_DECL
00137 
00138 #include /**/ "ace/post.h"
00139 #endif /* TAO_OPTABLE_H */

Generated on Thu Nov 9 12:40:39 2006 for TAO_PortableServer by doxygen 1.3.6