summaryrefslogtreecommitdiff
path: root/TAO/tao/IORInterceptor/IORInterceptor_List.h
blob: 05bd4f9d3c5614b71446a49d44f8a5a368e5e8ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// -*- C++ -*-

// ===================================================================
/**
 *  @file   IORInterceptor_List.h
 *
 *  $Id$
 *
 *  @author Ossama Othman <ossama@uci.edu>
 */
// ===================================================================

#ifndef TAO_IOR_INTERCEPTOR_LIST_H
#define TAO_IOR_INTERCEPTOR_LIST_H

#include /**/ "ace/pre.h"

#include "iorinterceptor_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "IORInterceptorC.h"

#include "tao/Interceptor_List.h"
#include "tao/PortableServer/ORT_Adapter.h"

/**
 * @class TAO_IORInterceptor_List
 *
 * @brief Encapsulation for a list of IOR interceptors.
 */
class TAO_IORInterceptor_Export TAO_IORInterceptor_List
  : public TAO_Interceptor_List
{
public:

  /// Define a trait for the underlying portable interceptor array.
  typedef ACE_Array_Base<PortableInterceptor::IORInterceptor_var> TYPE;

public:

  /// Constructor
  TAO_IORInterceptor_List (void);

  /// Destructor.
  virtual ~TAO_IORInterceptor_List (void);

  /// Register an IOR interceptor.
  void add_interceptor (PortableInterceptor::IORInterceptor_ptr
                        ACE_ENV_ARG_DECL);

  /// Return reference to the underlying Portable Interceptor array.
  TYPE & interceptors (void);

  void adapter_state_changed (
      const TAO::ORT_Array &array_obj_ref_template,
      PortableInterceptor::AdapterState state
      ACE_ENV_ARG_DECL)
    ACE_THROW_SPEC ((CORBA::SystemException));

protected:

  /// Return the length of the underlying interceptor array.
  virtual size_t length (void);

  /// Set the length of the underlying interceptor array.
  virtual void length (size_t);

  /// Return the interceptor in array element @a index.
  virtual PortableInterceptor::Interceptor_ptr interceptor (size_t index);

private:

  /// Dynamic array of registered IOR interceptors.
  TYPE interceptors_;
};


#if defined (__ACE_INLINE__)
#include "IORInterceptor_List.inl"
#endif /* defined INLINE */

#include /**/ "ace/post.h"
#endif /*TAO_IOR_INTERCEPTOR_LIST_H*/