Interceptor_List_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // ===================================================================
00004 /**
00005  *  @file   Interceptor_List_T.h
00006  *
00007  *  $Id: Interceptor_List_T.h 80823 2008-03-04 10:11:35Z johnnyw $
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/orbconf.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 (InterceptorType_ptr_type i);
00068 
00069     /// Register an interceptor with policies.
00070     void add_interceptor (InterceptorType_ptr_type i,
00071                           const CORBA::PolicyList& policies);
00072 
00073     void destroy_interceptors (void);
00074 
00075     /// Return the registered interceptor in sequence element @a index.
00076     RegisteredInterceptor& registered_interceptor (size_t index);
00077 
00078     /// Return the interceptor in sequence element @a index.
00079     InterceptorType_ptr_type interceptor (size_t index);
00080 
00081     size_t size (void) const;
00082 
00083   private:
00084     typedef ACE_Array_Base<RegisteredInterceptor > RegisteredArray;
00085 
00086     /// Dynamic array of registered interceptors.
00087     RegisteredArray interceptors_;
00088   };
00089 }
00090 
00091 TAO_END_VERSIONED_NAMESPACE_DECL
00092 
00093 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00094 #include "tao/PI/Interceptor_List_T.cpp"
00095 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00096 
00097 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00098 #pragma implementation ("Interceptor_List_T.cpp")
00099 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00100 
00101 #include /**/ "ace/post.h"
00102 
00103 #endif /* TAO_INTERCEPTOR_LIST_H */

Generated on Tue Feb 2 17:42:01 2010 for TAO_PI by  doxygen 1.4.7