TAO_Service_Context_Registry Class Reference

#include <Service_Context_Handler_Registry.h>

Collaboration diagram for TAO_Service_Context_Registry:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~TAO_Service_Context_Registry (void)
 Destructor.
int bind (IOP::ServiceId id, TAO_Service_Context_Handler *handler)
TAO_Service_Context_Handleroperator[] (IOP::ServiceId id)
int process_service_contexts (TAO_ServerRequest &server_request)

Private Types

typedef ACE_Array_Map< IOP::ServiceId,
TAO_Service_Context_Handler * > 
Table
typedef Table::key_type key_type
typedef Table::data_type data_type
typedef Table::value_type value_type
typedef Table::size_type size_type
typedef value_typeiterator

Private Attributes

Table registry_

Detailed Description

Definition at line 31 of file Service_Context_Handler_Registry.h.


Member Typedef Documentation

typedef Table::data_type TAO_Service_Context_Registry::data_type [private]

Definition at line 54 of file Service_Context_Handler_Registry.h.

typedef value_type* TAO_Service_Context_Registry::iterator [private]

Definition at line 57 of file Service_Context_Handler_Registry.h.

typedef Table::key_type TAO_Service_Context_Registry::key_type [private]

Definition at line 53 of file Service_Context_Handler_Registry.h.

typedef Table::size_type TAO_Service_Context_Registry::size_type [private]

Definition at line 56 of file Service_Context_Handler_Registry.h.

typedef ACE_Array_Map<IOP::ServiceId, TAO_Service_Context_Handler*> TAO_Service_Context_Registry::Table [private]

Definition at line 52 of file Service_Context_Handler_Registry.h.

typedef Table::value_type TAO_Service_Context_Registry::value_type [private]

Definition at line 55 of file Service_Context_Handler_Registry.h.


Constructor & Destructor Documentation

TAO_Service_Context_Registry::~TAO_Service_Context_Registry ( void   ) 

Destructor.

Definition at line 34 of file Service_Context_Handler_Registry.cpp.

References ACE_Array_Map< Key, Value, EqualTo >::end(), and registry_.

00035 {
00036   for (Table::iterator x = this->registry_.begin ();
00037        x != this->registry_.end ();
00038        ++x)
00039     {
00040       delete (*x).second;
00041     }
00042 }


Member Function Documentation

int TAO_Service_Context_Registry::bind ( IOP::ServiceId  id,
TAO_Service_Context_Handler handler 
)

Bind a new entry in the registry

Definition at line 45 of file Service_Context_Handler_Registry.cpp.

References ACE_Array_Map< Key, Value, EqualTo >::insert(), and registry_.

00048 {
00049   value_type const value =
00050     std::make_pair (key_type (id), data_type (handler));
00051 
00052   std::pair<iterator, bool> result = this->registry_.insert (value);
00053 
00054   return (result.second ? 0 : 1);
00055 }

TAO_Service_Context_Handler * TAO_Service_Context_Registry::operator[] ( IOP::ServiceId  id  ) 

Retrieve the entry related to id

Definition at line 58 of file Service_Context_Handler_Registry.cpp.

References registry_.

00059 {
00060   return registry_[id];
00061 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_Service_Context_Registry::process_service_contexts ( TAO_ServerRequest server_request  ) 

Definition at line 15 of file Service_Context_Handler_Registry.cpp.

References TAO_Service_Context_Handler::process_service_context(), registry_, TAO_ServerRequest::request_service_context(), and TAO_Service_Context::service_info().

00017 {
00018   IOP::ServiceContextList &service_info =
00019     server_request.request_service_context ().service_info ();
00020   for (CORBA::ULong index = 0;
00021        index != service_info.length ();
00022        ++index)
00023   {
00024     IOP::ServiceContext const & context = service_info[index];
00025     TAO_Service_Context_Handler* const handler = registry_[context.context_id];
00026     if (handler)
00027       {
00028         return handler->process_service_context (server_request, context);
00029       }
00030   }
00031   return 0;
00032 }


Member Data Documentation

Table TAO_Service_Context_Registry::registry_ [private]

Definition at line 59 of file Service_Context_Handler_Registry.h.

Referenced by bind(), operator[](), process_service_contexts(), and ~TAO_Service_Context_Registry().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:45 2010 for TAO by  doxygen 1.4.7