TAO_IOR_Table_Impl Class Reference

#include <IOR_Table_Impl.h>

Inheritance diagram for TAO_IOR_Table_Impl:

Inheritance graph
[legend]
Collaboration diagram for TAO_IOR_Table_Impl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_IOR_Table_Impl (void)
 Constructor.

char * find (const char *object_key) throw ( CORBA::SystemException, IORTable::NotFound )
 Find the object, using the locator if it is not on the table.

The IORTable::Table methods
Please check the IORTable.pidl file for details.

virtual void bind (const char *object_key, const char *IOR) throw ( CORBA::SystemException, IORTable::AlreadyBound )
virtual void rebind (const char *object_key, const char *IOR) throw ( CORBA::SystemException )
virtual void unbind (const char *object_key) throw ( CORBA::SystemException, IORTable::NotFound )
virtual void set_locator (IORTable::Locator_ptr the_locator) throw ( CORBA::SystemException )

Private Types

typedef ACE_Hash_Map_Manager_Ex<
ACE_CString, ACE_CString,
ACE_Hash< ACE_CString >,
ACE_Equal_To< ACE_CString >,
ACE_Null_Mutex
Map

Private Attributes

Map map_
 The map.

IORTable::Locator_var locator_
 The locator.

TAO_SYNCH_MUTEX lock_
 Synchronization.


Member Typedef Documentation

typedef ACE_Hash_Map_Manager_Ex<ACE_CString, ACE_CString, ACE_Hash<ACE_CString>, ACE_Equal_To<ACE_CString>, ACE_Null_Mutex> TAO_IOR_Table_Impl::Map [private]
 

Definition at line 99 of file IOR_Table_Impl.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_IOR_Table_Impl::TAO_IOR_Table_Impl void   ) 
 

Constructor.

Definition at line 20 of file IOR_Table_Impl.cpp.

00021 {
00022 }


Member Function Documentation

void TAO_IOR_Table_Impl::bind const char *  object_key,
const char *  IOR
throw ( CORBA::SystemException, IORTable::AlreadyBound ) [virtual]
 

Implements IORTable::Table.

Definition at line 51 of file IOR_Table_Impl.cpp.

References ACE_GUARD, ACE_THROW, and TAO_SYNCH_MUTEX.

00060 {
00061   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00062   if (this->map_.bind (object_key, IOR) != 0)
00063     ACE_THROW (IORTable::AlreadyBound ());
00064 }

char * TAO_IOR_Table_Impl::find const char *  object_key  )  throw ( CORBA::SystemException, IORTable::NotFound )
 

Find the object, using the locator if it is not on the table.

Definition at line 25 of file IOR_Table_Impl.cpp.

References ACE_CString, ACE_ENV_ARG_PARAMETER, ACE_GUARD_RETURN, ACE_THROW_RETURN, CORBA::is_nil(), CORBA::string_dup(), and TAO_SYNCH_MUTEX.

00031 {
00032   // We don't want the lock held during locate, so make it go out
00033   // of scope before then.
00034   {
00035     ACE_CString key (object_key);
00036     ACE_CString ior;
00037 
00038     ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00039     if (this->map_.find (key, ior) == 0)
00040       {
00041         return CORBA::string_dup (ior.c_str ());
00042       }
00043     if (CORBA::is_nil (this->locator_.in ()))
00044       ACE_THROW_RETURN (IORTable::NotFound (), 0);
00045   }
00046 
00047   return this->locator_->locate (object_key ACE_ENV_ARG_PARAMETER);
00048 }

void TAO_IOR_Table_Impl::rebind const char *  object_key,
const char *  IOR
throw ( CORBA::SystemException ) [virtual]
 

Implements IORTable::Table.

Definition at line 67 of file IOR_Table_Impl.cpp.

References ACE_GUARD, and TAO_SYNCH_MUTEX.

00075 {
00076   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00077   this->map_.rebind (object_key, IOR);
00078 }

void TAO_IOR_Table_Impl::set_locator IORTable::Locator_ptr  the_locator  )  throw ( CORBA::SystemException ) [virtual]
 

Definition at line 96 of file IOR_Table_Impl.cpp.

References IORTable::Locator::_duplicate(), ACE_GUARD, IORTable::Locator_ptr, and TAO_SYNCH_MUTEX.

00103 {
00104   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00105   this->locator_ = IORTable::Locator::_duplicate (locator);
00106 }

void TAO_IOR_Table_Impl::unbind const char *  object_key  )  throw ( CORBA::SystemException, IORTable::NotFound ) [virtual]
 

Implements IORTable::Table.

Definition at line 81 of file IOR_Table_Impl.cpp.

References ACE_GUARD, ACE_THROW, and TAO_SYNCH_MUTEX.

00089 {
00090   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00091   if (this->map_.unbind (object_key) != 0)
00092     ACE_THROW (IORTable::NotFound ());
00093 }


Member Data Documentation

IORTable::Locator_var TAO_IOR_Table_Impl::locator_ [private]
 

The locator.

Definition at line 105 of file IOR_Table_Impl.h.

TAO_SYNCH_MUTEX TAO_IOR_Table_Impl::lock_ [private]
 

Synchronization.

Definition at line 108 of file IOR_Table_Impl.h.

Map TAO_IOR_Table_Impl::map_ [private]
 

The map.

Definition at line 102 of file IOR_Table_Impl.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:07:16 2006 for TAO_IORTable by doxygen 1.3.6