#include <IOR_Table_Impl.h>
Inheritance diagram for TAO_IOR_Table_Impl:
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 | |
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. |
Definition at line 43 of file IOR_Table_Impl.h.
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.
TAO_IOR_Table_Impl::TAO_IOR_Table_Impl | ( | void | ) |
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().
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 }
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] |
Map TAO_IOR_Table_Impl::map_ [private] |