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)
 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)
virtual void rebind (const char *object_key, const char *IOR)
virtual void unbind (const char *object_key)
virtual void set_locator (IORTable::Locator_ptr the_locator)

Static Public Member Functions

static TAO_IOR_Table_Impl_ptr _nil (void)

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.

Detailed Description

Definition at line 43 of file IOR_Table_Impl.h.


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 79 of file IOR_Table_Impl.h.


Constructor & Destructor Documentation

TAO_IOR_Table_Impl::TAO_IOR_Table_Impl ( void   ) 

Constructor.

Definition at line 50 of file IOR_Table_Impl.cpp.

00051 {
00052 }


Member Function Documentation

static TAO_IOR_Table_Impl_ptr TAO_IOR_Table_Impl::_nil ( void   )  [inline, static]

Reimplemented from CORBA::LocalObject.

Definition at line 49 of file IOR_Table_Impl.h.

Referenced by TAO::Objref_Traits< TAO_IOR_Table_Impl >::nil().

00050   {
00051     return static_cast<TAO_IOR_Table_Impl_ptr> (0);
00052   }

void TAO_IOR_Table_Impl::bind ( const char *  object_key,
const char *  IOR 
) [virtual]

Definition at line 76 of file IOR_Table_Impl.cpp.

References ACE_GUARD, and TAO_SYNCH_MUTEX.

00077 {
00078   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00079   if (this->map_.bind (object_key, IOR) != 0)
00080     throw IORTable::AlreadyBound ();
00081 }

char * TAO_IOR_Table_Impl::find ( const char *  object_key  ) 

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

Definition at line 55 of file IOR_Table_Impl.cpp.

References ACE_GUARD_RETURN, CORBA::Object::ior(), CORBA::is_nil(), locator_, CORBA::string_dup(), and TAO_SYNCH_MUTEX.

00056 {
00057   // We don't want the lock held during locate, so make it go out
00058   // of scope before then.
00059   {
00060     ACE_CString key (object_key);
00061     ACE_CString ior;
00062 
00063     ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
00064     if (this->map_.find (key, ior) == 0)
00065       {
00066         return CORBA::string_dup (ior.c_str ());
00067       }
00068     if (CORBA::is_nil (this->locator_.in ()))
00069       throw IORTable::NotFound ();
00070   }
00071 
00072   return this->locator_->locate (object_key);
00073 }

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

Definition at line 84 of file IOR_Table_Impl.cpp.

References ACE_GUARD, map_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind(), and TAO_SYNCH_MUTEX.

00085 {
00086   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00087   this->map_.rebind (object_key, IOR);
00088 }

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

Definition at line 99 of file IOR_Table_Impl.cpp.

References ACE_GUARD, locator_, and TAO_SYNCH_MUTEX.

00100 {
00101   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00102   this->locator_ = IORTable::Locator::_duplicate (locator);
00103 }

void TAO_IOR_Table_Impl::unbind ( const char *  object_key  )  [virtual]

Definition at line 91 of file IOR_Table_Impl.cpp.

References ACE_GUARD, and TAO_SYNCH_MUTEX.

00092 {
00093   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00094   if (this->map_.unbind (object_key) != 0)
00095     throw IORTable::NotFound ();
00096 }


Member Data Documentation

IORTable::Locator_var TAO_IOR_Table_Impl::locator_ [private]

The locator.

Definition at line 85 of file IOR_Table_Impl.h.

Referenced by find(), and set_locator().

TAO_SYNCH_MUTEX TAO_IOR_Table_Impl::lock_ [private]

Synchronization.

Definition at line 88 of file IOR_Table_Impl.h.

Map TAO_IOR_Table_Impl::map_ [private]

The map.

Definition at line 82 of file IOR_Table_Impl.h.

Referenced by rebind().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:43:42 2010 for TAO_IORTable by  doxygen 1.4.7