Interceptor_List_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // ===================================================================
00004 /**
00005  *  @file   Interceptor_List_T.h
00006  *
00007  *  Interceptor_List_T.h,v 1.4 2006/03/10 07:19:12 jtc Exp
00008  *
00009  *  @author Ossama Othman <ossama@uci.edu>
00010  *  @author Johnny Willemsen  <jwillemsen@remedy.nl>
00011  */
00012 // ===================================================================
00013 
00014 #ifndef TAO_INTERCEPTOR_LIST_H
00015 #define TAO_INTERCEPTOR_LIST_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "ace/Array_Base.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "tao/SystemException.h"
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 namespace PortableInterceptor
00030 {
00031   class Interceptor;
00032   typedef Interceptor *Interceptor_ptr;
00033 }
00034 
00035 namespace CORBA
00036 {
00037   class PolicyList;
00038 }
00039 
00040 namespace TAO
00041 {
00042   /**
00043    * @class Interceptor_List
00044    *
00045    * @brief Template for portable interceptor lists.
00046    *
00047    * Template for the various portable interceptor lists used
00048    * internally by TAO.
00049    */
00050   template <typename InterceptorType, typename DetailsType>
00051   class Interceptor_List
00052   {
00053   public:
00054     /// Define the traits for the underlying portable interceptor array.
00055     typedef typename InterceptorType::_var_type InterceptorType_var_type;
00056     typedef typename InterceptorType::_ptr_type InterceptorType_ptr_type;
00057 
00058     struct RegisteredInterceptor
00059     {
00060       InterceptorType_var_type interceptor_;
00061       DetailsType              details_;
00062     };
00063 
00064     /// Constructor.
00065     Interceptor_List (void);
00066 
00067     void add_interceptor (
00068       InterceptorType_ptr_type i
00069       ACE_ENV_ARG_DECL);
00070 
00071     /// Register an interceptor with policies.
00072     void add_interceptor (InterceptorType_ptr_type i,
00073                           const CORBA::PolicyList& policies
00074                           ACE_ENV_ARG_DECL);
00075 
00076     void destroy_interceptors (ACE_ENV_SINGLE_ARG_DECL);
00077 
00078     /// Return the registered interceptor in sequence element @a index.
00079     RegisteredInterceptor& registered_interceptor (
00080       size_t index);
00081 
00082     /// Return the interceptor in sequence element @a index.
00083     InterceptorType_ptr_type interceptor (size_t index);
00084 
00085     size_t size (void);
00086 
00087   private:
00088 
00089     typedef ACE_Array_Base<RegisteredInterceptor > RegisteredArray;
00090 
00091     /// Dynamic array of registered interceptors.
00092     RegisteredArray interceptors_;
00093   };
00094 }
00095 
00096 TAO_END_VERSIONED_NAMESPACE_DECL
00097 
00098 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00099 #include "tao/PI/Interceptor_List_T.cpp"
00100 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00101 
00102 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00103 #pragma implementation ("Interceptor_List_T.cpp")
00104 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00105 
00106 #include /**/ "ace/post.h"
00107 
00108 #endif /* TAO_INTERCEPTOR_LIST_H */

Generated on Thu Nov 9 12:51:39 2006 for TAO_PI by doxygen 1.3.6