Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / PI / Interceptor_List_T.h
blob049027473eca5572f73ea1720d50d05681276d23
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file Interceptor_List_T.h
7 * @author Ossama Othman <ossama@uci.edu>
8 * @author Johnny Willemsen <jwillemsen@remedy.nl>
9 */
10 // ===================================================================
12 #ifndef TAO_INTERCEPTOR_LIST_H
13 #define TAO_INTERCEPTOR_LIST_H
15 #include /**/ "ace/pre.h"
17 #include "ace/Array_Base.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/orbconf.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 namespace PortableInterceptor
29 class Interceptor;
30 typedef Interceptor *Interceptor_ptr;
33 namespace CORBA
35 class PolicyList;
38 namespace TAO
40 /**
41 * @class Interceptor_List
43 * @brief Template for portable interceptor lists.
45 * Template for the various portable interceptor lists used
46 * internally by TAO.
48 template <typename InterceptorType, typename DetailsType>
49 class Interceptor_List
51 public:
52 /// Define the traits for the underlying portable interceptor array.
53 typedef typename InterceptorType::_var_type InterceptorType_var_type;
54 typedef typename InterceptorType::_ptr_type InterceptorType_ptr_type;
56 struct RegisteredInterceptor
58 InterceptorType_var_type interceptor_;
59 DetailsType details_;
62 /// Constructor.
63 Interceptor_List ();
65 void add_interceptor (InterceptorType_ptr_type i);
67 /// Register an interceptor with policies.
68 void add_interceptor (InterceptorType_ptr_type i,
69 const CORBA::PolicyList& policies);
71 void destroy_interceptors ();
73 /// Return the registered interceptor in sequence element @a index.
74 RegisteredInterceptor& registered_interceptor (size_t index);
76 /// Return the interceptor in sequence element @a index.
77 InterceptorType_ptr_type interceptor (size_t index);
79 size_t size () const;
81 private:
82 typedef ACE_Array_Base<RegisteredInterceptor > RegisteredArray;
84 /// Dynamic array of registered interceptors.
85 RegisteredArray interceptors_;
89 TAO_END_VERSIONED_NAMESPACE_DECL
91 #include "tao/PI/Interceptor_List_T.cpp"
93 #include /**/ "ace/post.h"
95 #endif /* TAO_INTERCEPTOR_LIST_H */