Public Member Functions | Private Types | Private Attributes

TAO::CSD::TP_Servant_State_Map Class Reference

Map of Servant_State objects - one per servant. More...

#include <CSD_TP_Servant_State_Map.h>

Collaboration diagram for TAO::CSD::TP_Servant_State_Map:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TP_Servant_State_Map ()
 Default Constructor.
 ~TP_Servant_State_Map ()
 Destructor.
TP_Servant_Statefind (PortableServer::Servant servant)
 Accessor for the servant busy flag.
void insert (PortableServer::Servant servant)
 Insert the servant to map.
void remove (PortableServer::Servant servant)
 Remove the servant from map.

Private Types

typedef
ACE_Hash_Map_Manager_Ex< void
*, TP_Servant_State::HandleType,
ACE_Hash< void * >
, ACE_Equal_To< void * >
, TAO_SYNCH_MUTEX > 
MapType

Private Attributes

MapType map_
 The underlying map of servant state objects.

Detailed Description

Map of Servant_State objects - one per servant.

A TP_Stategy object holds an instance of a TP_Servant_State_Map object as a (held-by-value) data member. The strategy uses this map to find or create the TP_Servant_State object for a particular servant object.

Definition at line 47 of file CSD_TP_Servant_State_Map.h.


Member Typedef Documentation

typedef ACE_Hash_Map_Manager_Ex<void*, TP_Servant_State::HandleType, ACE_Hash<void*>, ACE_Equal_To<void*>, TAO_SYNCH_MUTEX> TAO::CSD::TP_Servant_State_Map::MapType [private]

Underlying Map Type - Hash-Based - Key Type: void*, Value Type: TP_Servant_State::HandleType

Definition at line 78 of file CSD_TP_Servant_State_Map.h.


Constructor & Destructor Documentation

TAO::CSD::TP_Servant_State_Map::TP_Servant_State_Map (  ) 

Default Constructor.

Definition at line 8 of file CSD_TP_Servant_State_Map.inl.

{
}

TAO::CSD::TP_Servant_State_Map::~TP_Servant_State_Map (  ) 

Destructor.

Definition at line 14 of file CSD_TP_Servant_State_Map.inl.

{
}


Member Function Documentation

TAO::CSD::TP_Servant_State * TAO::CSD::TP_Servant_State_Map::find ( PortableServer::Servant  servant  ) 

Accessor for the servant busy flag.

Definition at line 21 of file CSD_TP_Servant_State_Map.inl.

{
  void* key = servant;

  TP_Servant_State::HandleType value;

  if (this->map_.find(key, value) != 0)
    {
      throw PortableServer::POA::ServantNotActive ();
    }

  return value._retn();
}

void TAO::CSD::TP_Servant_State_Map::insert ( PortableServer::Servant  servant  ) 

Insert the servant to map.

Definition at line 38 of file CSD_TP_Servant_State_Map.inl.

{
  void* key = servant;

  TP_Servant_State::HandleType value = new TP_Servant_State ();

  int const result = this->map_.bind(key, value);

  if (result == 1)
    {
      throw PortableServer::POA::ServantAlreadyActive ();
    }

  ACE_ASSERT (result == 0);
}

void TAO::CSD::TP_Servant_State_Map::remove ( PortableServer::Servant  servant  ) 

Remove the servant from map.

Definition at line 57 of file CSD_TP_Servant_State_Map.inl.

{
  void* key = servant;

  if (this->map_.unbind(key) == -1)
    {
      throw PortableServer::POA::ServantNotActive ();
    }
}


Member Data Documentation

MapType TAO::CSD::TP_Servant_State_Map::map_ [private]

The underlying map of servant state objects.

Definition at line 81 of file CSD_TP_Servant_State_Map.h.


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