#include <ObjectKey_Table.h>
Collaboration diagram for TAO::ObjectKey_Table:
Public Member Functions | |
ObjectKey_Table (void) | |
Default Constructor and destructor.. | |
~ObjectKey_Table (void) | |
int | init (TAO_ORB_Core *orb) |
int | destroy (void) |
Iterates and unbinds the contents of the table. | |
int | bind (const ObjectKey &key, Refcounted_ObjectKey *&key_new) |
Bind the ObjectKey in the table. | |
int | unbind (TAO::Refcounted_ObjectKey *&key) |
Unbind an ObjectKey from the table. | |
Protected Member Functions | |
int | bind_i (const ObjectKey &key, Refcounted_ObjectKey *&key_new) |
Implementation for bind (). | |
int | unbind_i (Refcounted_ObjectKey *&key) |
Implementation for unbind (). | |
Private Types | |
typedef ACE_RB_Tree< TAO::ObjectKey, TAO::Refcounted_ObjectKey *, TAO::Less_Than_ObjectKey, ACE_Null_Mutex > | TABLE |
Private Attributes | |
ACE_Lock * | lock_ |
Lock for the table. | |
TABLE | table_ |
Table that contains the data. |
The ORB maintains one table for the whole ORB. ObjectKeys generated by the ORB or the ones seen by the ORB from remote ORB's are stored here. The ObjectKeys are stored through a wrapper which encapsulates the refcount on them. This class actually provides the synchronization mechanism for manipulating the reference counts on the object keys provided by the wrapper class.
This class does not offer a find () call with a reason. The call to bind () will return a pointer which is expected to be cached by the client/caller and use the pointer in every invocation.
The reasons to use RB_Tree are its good dynamic properties. We should try to strategize the class to use either a Hash_Map or a RB_Tree based on some runtime option. For that we need an adapter class in ACE, like an ACE_Lock_Adapter class. We will do that if our instrumentation shows the need for it.
|
|
|
Default Constructor and destructor..
|
|
|
|
Bind the ObjectKey in the table. Bind an ObjectKey in the table and return a pointer to the Refcounted_ObjectKey which the client can use. If the ObjectKey is already available in the table, this operation just increments the refcount on the ObjectKey. If the ObjectKey is new it is bounded to the table. Returns a 0 on success and a -1 on failure. |
|
Implementation for bind ().
|
|
Iterates and unbinds the contents of the table.
|
|
Initialize method that sets up the underlying lock and other related stuff. |
|
Unbind an ObjectKey from the table.
|
|
Implementation for unbind ().
|
|
Lock for the table.
|
|
Table that contains the data.
|