Public Member Functions | Private Types | Private Attributes

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 (IOP::ServiceContextList &sc, TAO_Transport &transport)
int generate_service_context (TAO_Stub *stub, TAO_Transport &transport, TAO_Operation_Details &opdetails, TAO_Target_Specification &spec, TAO_OutputCDR &msg)

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 34 of file Service_Context_Handler_Registry.h.


Member Typedef Documentation

Definition at line 64 of file Service_Context_Handler_Registry.h.

Definition at line 67 of file Service_Context_Handler_Registry.h.

Definition at line 63 of file Service_Context_Handler_Registry.h.

Definition at line 66 of file Service_Context_Handler_Registry.h.

Definition at line 62 of file Service_Context_Handler_Registry.h.

Definition at line 65 of file Service_Context_Handler_Registry.h.


Constructor & Destructor Documentation

TAO_Service_Context_Registry::~TAO_Service_Context_Registry ( void   ) 

Destructor.

Definition at line 58 of file Service_Context_Handler_Registry.cpp.

{
  for (Table::iterator x = this->registry_.begin ();
       x != this->registry_.end ();
       ++x)
    {
      delete (*x).second;
    }
}


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 69 of file Service_Context_Handler_Registry.cpp.

{
  value_type const value =
    std::make_pair (key_type (id), data_type (handler));

  std::pair<iterator, bool> result = this->registry_.insert (value);

  return (result.second ? 0 : 1);
}

int TAO_Service_Context_Registry::generate_service_context ( TAO_Stub stub,
TAO_Transport transport,
TAO_Operation_Details opdetails,
TAO_Target_Specification spec,
TAO_OutputCDR msg 
)

Definition at line 36 of file Service_Context_Handler_Registry.cpp.

{
  int result = 0;
  for (Table::iterator x = this->registry_.begin ();
       x != this->registry_.end ();
       ++x)
    {
      if ((*x).second->generate_service_context (
        stub, transport, opdetails, spec, msg) == -1)
        {
          result = -1;
          }
    }

  return result;
}

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

Retrieve the entry related to id

Definition at line 82 of file Service_Context_Handler_Registry.cpp.

{
  return registry_[id];
}

int TAO_Service_Context_Registry::process_service_contexts ( IOP::ServiceContextList &  sc,
TAO_Transport transport 
)

Definition at line 15 of file Service_Context_Handler_Registry.cpp.

{
  for (CORBA::ULong index = 0;
       index != sc.length ();
       ++index)
  {
    IOP::ServiceContext const & context = sc[index];

    iterator handler_iter = this->registry_.find (context.context_id);

    if (handler_iter != registry_.end ())
      {
        return handler_iter->second->process_service_context (transport, context);
      }
  }
  return 0;
}


Member Data Documentation

Definition at line 69 of file Service_Context_Handler_Registry.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines