#include <Transient_Naming_Context.h>
Inheritance diagram for TAO_Transient_Bindings_Map:
Public Types | |
typedef ACE_Hash_Map_Manager< TAO_ExtId, TAO_IntId, ACE_Null_Mutex > | HASH_MAP |
Underlying data structure - typedef for ease of use. | |
Public Member Functions | |
TAO_Transient_Bindings_Map (size_t hash_table_size) | |
Constructor. | |
virtual | ~TAO_Transient_Bindings_Map (void) |
Destructor. | |
HASH_MAP & | map (void) |
Get a reference to the underlying hash map. | |
size_t | total_size (void) |
Return the size of the underlying hash table. | |
virtual size_t | current_size (void) |
virtual int | bind (const char *id, const char *kind, CORBA::Object_ptr obj, CosNaming::BindingType type) |
virtual int | rebind (const char *id, const char *kind, CORBA::Object_ptr obj, CosNaming::BindingType type) |
virtual int | unbind (const char *id, const char *kind) |
virtual int | find (const char *id, const char *kind, CORBA::Object_ptr &obj, CosNaming::BindingType &type) |
Private Member Functions | |
int | shared_bind (const char *id, const char *kind, CORBA::Object_ptr obj, CosNaming::BindingType type, int rebind) |
Helper: factors common code from and . | |
Private Attributes | |
HASH_MAP | map_ |
Hash map used for storage. |
A thin wrapper on top of ACE_Hash_Map_Manager. Supports TAO_Bindings_Map interface. Used by TAO_Transient_Naming_Context.
Definition at line 38 of file Transient_Naming_Context.h.
|
Underlying data structure - typedef for ease of use.
Definition at line 43 of file Transient_Naming_Context.h. |
|
Constructor.
Definition at line 70 of file Transient_Naming_Context.cpp.
00071 : map_ (hash_table_size) 00072 { 00073 } |
|
Destructor.
Definition at line 75 of file Transient_Naming_Context.cpp.
00076 { 00077 } |
|
Add a binding with the specified parameters to the table. Return 0 on success and -1 on failure, 1 if there already is a binding with and . Implements TAO_Bindings_Map. Definition at line 33 of file Transient_Naming_Context.cpp. References shared_bind().
00037 { 00038 return this->shared_bind (id, kind, obj, type, 0); 00039 } |
|
Return current number of entries (name bindings) in the underlying hash map. Implements TAO_Bindings_Map. Definition at line 86 of file Transient_Naming_Context.cpp.
00087 { 00088 return map_.current_size (); 00089 } |
|
Find the binding containing and in the table, and pass binding's type and object back to the caller by reference. Return 0 on success and -1 on failure. Note: a 'duplicated' object reference is assigned to , so the caller is responsible for its deallocation. Implements TAO_Bindings_Map. Definition at line 51 of file Transient_Naming_Context.cpp. References CORBA::Object::_duplicate(), TAO_IntId::ref_, and TAO_IntId::type_.
|
|
Get a reference to the underlying hash map.
Definition at line 80 of file Transient_Naming_Context.cpp. Referenced by TAO_Transient_Naming_Context::list().
00081 { 00082 return map_; 00083 } |
|
Overwrite a binding containing and (or create a new one if one doesn't exist) with the specified parameters. Return 0 or 1 on success. Return -1 or -2 on failure. (-2 is returned if the new and old bindings differ in type). Implements TAO_Bindings_Map. Definition at line 42 of file Transient_Naming_Context.cpp. References shared_bind().
00046 { 00047 return this->shared_bind (id, kind, obj, type, 1); 00048 } |
|
Helper: factors common code from and .
Definition at line 98 of file Transient_Naming_Context.cpp. References TAO_IntId::type_. Referenced by bind(), and rebind().
00103 { 00104 TAO_ExtId new_name (id, kind); 00105 TAO_IntId new_entry (obj, type); 00106 TAO_IntId old_entry; 00107 00108 if (rebind == 0) 00109 // Do a normal bind. 00110 return this->map_.bind (new_name, new_entry); 00111 00112 else 00113 // Rebind. 00114 { 00115 // Check that types of old and new entries match. 00116 if (this->map_.find (new_name, 00117 old_entry) == 0 00118 && type != old_entry.type_) 00119 return -2; 00120 00121 else 00122 return this->map_.rebind (new_name, new_entry); 00123 } 00124 } |
|
Return the size of the underlying hash table.
Definition at line 92 of file Transient_Naming_Context.cpp. Referenced by TAO_Transient_Naming_Context::new_context().
00093 { 00094 return map_.total_size (); 00095 } |
|
Remove a binding containing and from the table. Return 0 on success and -1 on failure. Implements TAO_Bindings_Map. Definition at line 25 of file Transient_Naming_Context.cpp.
|
|
Hash map used for storage.
Definition at line 117 of file Transient_Naming_Context.h. |