#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 65 of file Transient_Naming_Context.cpp.
00066 : map_ (hash_table_size) 00067 { 00068 } |
|
Destructor.
Definition at line 70 of file Transient_Naming_Context.cpp.
00071 { 00072 } |
|
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 28 of file Transient_Naming_Context.cpp. References shared_bind().
00032 { 00033 return this->shared_bind (id, kind, obj, type, 0); 00034 } |
|
Return current number of entries (name bindings) in the underlying hash map. Implements TAO_Bindings_Map. Definition at line 81 of file Transient_Naming_Context.cpp.
00082 { 00083 return map_.current_size (); 00084 } |
|
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 46 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 75 of file Transient_Naming_Context.cpp. Referenced by TAO_Transient_Naming_Context::list().
00076 { 00077 return map_; 00078 } |
|
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 37 of file Transient_Naming_Context.cpp. References shared_bind().
00041 { 00042 return this->shared_bind (id, kind, obj, type, 1); 00043 } |
|
Helper: factors common code from and .
Definition at line 93 of file Transient_Naming_Context.cpp. References TAO_IntId::type_. Referenced by bind(), and rebind().
00098 { 00099 TAO_ExtId new_name (id, kind); 00100 TAO_IntId new_entry (obj, type); 00101 TAO_IntId old_entry; 00102 00103 if (rebind == 0) 00104 // Do a normal bind. 00105 return this->map_.bind (new_name, new_entry); 00106 00107 else 00108 // Rebind. 00109 { 00110 // Check that types of old and new entries match. 00111 if (this->map_.find (new_name, 00112 old_entry) == 0 00113 && type != old_entry.type_) 00114 return -2; 00115 00116 else 00117 return this->map_.rebind (new_name, new_entry); 00118 } 00119 } |
|
Return the size of the underlying hash table.
Definition at line 87 of file Transient_Naming_Context.cpp. Referenced by TAO_Transient_Naming_Context::new_context().
00088 { 00089 return map_.total_size (); 00090 } |
|
Remove a binding containing and from the table. Return 0 on success and -1 on failure. Implements TAO_Bindings_Map. Definition at line 21 of file Transient_Naming_Context.cpp.
|
|
Hash map used for storage.
Definition at line 117 of file Transient_Naming_Context.h. |