Operation_Table.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Operation_Table.h
00006  *
00007  *  $Id: Operation_Table.h 76551 2007-01-24 13:42:44Z johnnyw $
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 typedef void (*TAO_Skeleton)(
00033     TAO_ServerRequest &,
00034     void *,
00035     void *
00036   );
00037 
00038 typedef void (*TAO_Collocated_Skeleton)(
00039     TAO_Abstract_ServantBase *,
00040     TAO::Argument **,
00041     int
00042   );
00043 
00044 /**
00045  * @struct TAO_operation_db_entry
00046  *
00047  * @brief Define a table entry that holds an operation name and its
00048  * corresponding skeleton.  A table of such entries is used to
00049  * initialize the different lookup strategies.
00050  */
00051 struct TAO_operation_db_entry
00052 {
00053   /// Operation name
00054   char const * opname;
00055 
00056   /// Remote/thru-POA skeleton pointer
00057   TAO_Skeleton skel_ptr;
00058 
00059   /// Collocated skeleton pointers.
00060   TAO_Collocated_Skeleton direct_skel_ptr;
00061 };
00062 
00063 // --------------------------
00064 
00065 namespace TAO
00066 {
00067   /**
00068    * @class Operation_Skeleton_Ptr
00069    *
00070    * @brief A logical aggregation of all the operation skeleton pointers
00071    * in use.
00072    *
00073    * This is not used by the IDL compiler. This is used internally
00074    * within different strategies.
00075    */
00076   struct Operation_Skeletons
00077   {
00078     Operation_Skeletons (void);
00079 
00080     /// Remote skeleton pointer
00081     TAO_Skeleton skel_ptr;
00082 
00083     /// Collocated skeleton pointers.
00084     TAO_Skeleton thruPOA_skel_ptr;
00085     TAO_Collocated_Skeleton direct_skel_ptr;
00086   };
00087 }
00088 
00089 /**
00090  * @class TAO_Operation_Table
00091  *
00092  * @brief Abstract class for maintaining and lookup of CORBA IDL
00093  * operation names.
00094  */
00095 class TAO_PortableServer_Export TAO_Operation_Table
00096 {
00097 public:
00098   /**
00099    * Uses @a opname to look up the skeleton function and pass it back
00100    * in @a skelfunc.  Returns non-negative integer on success, or -1
00101    * on failure.
00102    */
00103   virtual int find (const char *opname,
00104                     TAO_Skeleton &skelfunc,
00105                     const unsigned int length = 0) = 0;
00106 
00107   /**
00108    * Uses @a opname to look up the collocated skeleton function and
00109    * pass it back in @a skelfunc.  Returns non-negative integer on
00110    * success, or -1 on failure.
00111    */
00112   virtual int find (const char *opname,
00113                     TAO_Collocated_Skeleton &skelfunc,
00114                     TAO::Collocation_Strategy s,
00115                     const unsigned int length = 0) = 0;
00116 
00117   /// Associate the skeleton @a skel_ptr with an operation named
00118   /// @a opname.  Returns -1 on failure, 0 on success, 1 on duplicate.
00119   virtual int bind (const char *opname,
00120                     const TAO::Operation_Skeletons skel_ptr) = 0;
00121 
00122   virtual ~TAO_Operation_Table (void);
00123 };
00124 
00125 TAO_END_VERSIONED_NAMESPACE_DECL
00126 
00127 #include /**/ "ace/post.h"
00128 #endif /* TAO_OPTABLE_H */

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