Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Interceptor_List Class Reference

Base class for portable interceptor lists. More...

#include <Interceptor_List.h>

Inheritance diagram for TAO_Interceptor_List:

Inheritance graph
[legend]
List of all members.

Public Methods

 TAO_Interceptor_List (void)
 Constructor. More...

virtual ~TAO_Interceptor_List (void)
 Destructor. More...


Protected Methods

size_t add_interceptor_i (PortableInterceptor::Interceptor_ptr interceptor ACE_ENV_ARG_DECL) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
 Register an in interceptor with interceptor list. More...

virtual size_t length (void)=0
 Return the length of the underlying interceptor sequence. More...

virtual void length (size_t)=0
 Set the length of the underlying interceptor sequence. More...

virtual PortableInterceptor::Interceptor_ptr interceptor (size_t index)=0
 Return the interceptor in sequence element <index>. More...


Detailed Description

Base class for portable interceptor lists.

Base class for the various portable interceptor lists used internally by TAO.

Definition at line 37 of file Interceptor_List.h.


Constructor & Destructor Documentation

TAO_Interceptor_List::TAO_Interceptor_List void   
 

Constructor.

Definition at line 18 of file Interceptor_List.cpp.

00019 {
00020 }

TAO_Interceptor_List::~TAO_Interceptor_List void    [virtual]
 

Destructor.

Definition at line 22 of file Interceptor_List.cpp.

00023 {
00024 }


Member Function Documentation

size_t TAO_Interceptor_List::add_interceptor_i PortableInterceptor::Interceptor_ptr interceptor    ACE_ENV_ARG_DECL throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName) [protected]
 

Register an in interceptor with interceptor list.

Definition at line 27 of file Interceptor_List.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, CORBA::is_nil, ACE_OS_String::strcmp, ACE_OS_String::strlen, and TAO_DEFAULT_MINOR_CODE.

00032 {
00033   if (!CORBA::is_nil (interceptor))
00034     {
00035       /// If the Interceptor is not anonymous, make sure an
00036       /// Interceptor with the same isn't already registered.
00037       CORBA::String_var name = interceptor->name (
00038         ACE_ENV_SINGLE_ARG_PARAMETER);
00039       ACE_CHECK_RETURN (0);
00040 
00041       size_t old_len = this->length ();
00042 
00043       if (ACE_OS_String::strlen (name.in ()) != 0)
00044         {
00045           // @@ This simple search algorithm isn't the greatest thing
00046           //    in the world, but since we only register interceptors
00047           //    when bootstrapping an ORB, there will be no run-time
00048           //    penalty.
00049           //
00050           //    Another source of inefficiency is that Interceptors
00051           //    duplicate their name each time the name() accessor is
00052           //    called!  This can slow down bootstrap time noticeably
00053           //    when registering a huge number of interceptors.  We
00054           //    could cache the names somewhere, but since this is
00055           //    only a bootstrapping issue there's no rush to
00056           //    implement such a scheme.
00057 
00058           /// Prevent interceptors with the same name from being
00059           /// registered.  Anonymous interceptors are okay.
00060           for (size_t i = 0; i < old_len; ++i)
00061             {
00062               CORBA::String_var existing_name =
00063                 this->interceptor (i)->name ();
00064               if (ACE_OS_String::strcmp (existing_name.in (),
00065                                          name.in ()) == 0)
00066                 ACE_THROW_RETURN
00067                   (PortableInterceptor::ORBInitInfo::DuplicateName (),
00068                    0);
00069             }
00070         }
00071 
00072       /// Increase the length of the Interceptor sequence by one.
00073       size_t new_len = old_len + 1;
00074       this->length (new_len);
00075           return old_len;
00076     }
00077   else
00078     ACE_THROW_RETURN (CORBA::INV_OBJREF (
00079                         CORBA_SystemException::_tao_minor_code (
00080                           TAO_DEFAULT_MINOR_CODE,
00081                           EINVAL),
00082                         CORBA::COMPLETED_NO),
00083                       0);
00084 }

virtual PortableInterceptor::Interceptor_ptr TAO_Interceptor_List::interceptor size_t    index [protected, pure virtual]
 

Return the interceptor in sequence element <index>.

Implemented in TAO_ClientRequestInterceptor_List.

virtual void TAO_Interceptor_List::length size_t    [protected, pure virtual]
 

Set the length of the underlying interceptor sequence.

Implemented in TAO_ClientRequestInterceptor_List.

virtual size_t TAO_Interceptor_List::length void    [protected, pure virtual]
 

Return the length of the underlying interceptor sequence.

Implemented in TAO_ClientRequestInterceptor_List.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:22:16 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002