Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

TAO_Storable_Bindings_Map Class Reference

Provides hash-table-based transient storage for name to object bindings in a Naming Context. More...

#include <Storable_Naming_Context.h>

Inheritance diagram for TAO_Storable_Bindings_Map:

Inheritance graph
[legend]
Collaboration diagram for TAO_Storable_Bindings_Map:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Hash_Map_Manager<
TAO_Persistent_ExtId, TAO_Persistent_IntId,
ACE_Null_Mutex
HASH_MAP
 Underlying data structure - typedef for ease of use. More...


Public Methods

 TAO_Storable_Bindings_Map (size_t hash_table_size)
 Constructor. More...

 TAO_Storable_Bindings_Map (size_t hash_table_size, CORBA::ORB_ptr orb, const char *poa_id, PortableServer::POA_ptr poa)
 Constructor. More...

virtual ~TAO_Storable_Bindings_Map (void)
 Destructor. More...

HASH_MAPmap (void)
 Get a reference to the underlying hash map. More...

size_t total_size (void)
 Return the size of the underlying hash table. More...

virtual size_t current_size (void)
 Return current number of entries (name bindings) in the underlying hash map. More...

virtual int bind (const char *id, const char *kind, CORBA::Object_ptr obj, CosNaming::BindingType type)
 Add a binding with the specified parameters to the table. More...

virtual int rebind (const char *id, const char *kind, CORBA::Object_ptr obj, CosNaming::BindingType type)
 Overwrite a binding containing <id> and <kind> (or create a new one if one doesn't exist) with the specified parameters. More...

virtual int unbind (const char *id, const char *kind)
 Remove a binding containing <id> and <kind> from the table. More...

virtual int find (const char *id, const char *kind, CORBA::Object_ptr &obj, CosNaming::BindingType &type)
 Find the binding containing <id> and <kind> in the table, and pass binding's type and object back to the caller by reference. More...

virtual void Write (TAO_Writer_Base &wrtr)
virtual const char * name ()

Private Methods

int shared_bind (const char *id, const char *kind, CORBA::Object_ptr obj, CosNaming::BindingType type, int rebind)
 Helper: factors common code from <bind> and <rebind>. More...


Private Attributes

HASH_MAP map_
 Hash map used for storage. More...

CORBA::ORB_ptr orb_
ACE_CString name_
PortableServer::POA_var poa_

Detailed Description

Provides hash-table-based transient storage for name to object bindings in a Naming Context.

A thin wrapper on top of ACE_Hash_Map_Manager. Supports TAO_Bindings_Map interface. Used by TAO_Transient_Naming_Context.


Member Typedef Documentation

typedef ACE_Hash_Map_Manager<TAO_Persistent_ExtId, TAO_Persistent_IntId, ACE_Null_Mutex> TAO_Storable_Bindings_Map::HASH_MAP
 

Underlying data structure - typedef for ease of use.


Constructor & Destructor Documentation

TAO_Storable_Bindings_Map::TAO_Storable_Bindings_Map size_t    hash_table_size
 

Constructor.

TAO_Storable_Bindings_Map::TAO_Storable_Bindings_Map size_t    hash_table_size,
CORBA::ORB_ptr    orb,
const char *    poa_id,
PortableServer::POA_ptr    poa
 

Constructor.

TAO_Storable_Bindings_Map::~TAO_Storable_Bindings_Map void    [virtual]
 

Destructor.


Member Function Documentation

int TAO_Storable_Bindings_Map::bind const char *    id,
const char *    kind,
CORBA::Object_ptr    obj,
CosNaming::BindingType    type
[virtual]
 

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 <id> and <kind>.

Reimplemented from TAO_Bindings_Map.

size_t TAO_Storable_Bindings_Map::current_size void    [virtual]
 

Return current number of entries (name bindings) in the underlying hash map.

Reimplemented from TAO_Bindings_Map.

int TAO_Storable_Bindings_Map::find const char *    id,
const char *    kind,
CORBA::Object_ptr   obj,
CosNaming::BindingType   type
[virtual]
 

Find the binding containing <id> and <kind> 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 <obj>, so the caller is responsible for its deallocation.

Reimplemented from TAO_Bindings_Map.

TAO_Storable_Bindings_Map::HASH_MAP & TAO_Storable_Bindings_Map::map void   
 

Get a reference to the underlying hash map.

const char * TAO_Storable_Bindings_Map::name   [virtual]
 

int TAO_Storable_Bindings_Map::rebind const char *    id,
const char *    kind,
CORBA::Object_ptr    obj,
CosNaming::BindingType    type
[virtual]
 

Overwrite a binding containing <id> and <kind> (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).

Reimplemented from TAO_Bindings_Map.

int TAO_Storable_Bindings_Map::shared_bind const char *    id,
const char *    kind,
CORBA::Object_ptr    obj,
CosNaming::BindingType    type,
int    rebind
[private]
 

Helper: factors common code from <bind> and <rebind>.

size_t TAO_Storable_Bindings_Map::total_size void   
 

Return the size of the underlying hash table.

int TAO_Storable_Bindings_Map::unbind const char *    id,
const char *    kind
[virtual]
 

Remove a binding containing <id> and <kind> from the table.

Return 0 on success and -1 on failure.

Reimplemented from TAO_Bindings_Map.

void TAO_Storable_Bindings_Map::Write TAO_Writer_Base   wrtr [virtual]
 

Reimplemented from TAO_Storable_Base.


Member Data Documentation

HASH_MAP TAO_Storable_Bindings_Map::map_ [private]
 

Hash map used for storage.

ACE_CString TAO_Storable_Bindings_Map::name_ [private]
 

CORBA::ORB_ptr TAO_Storable_Bindings_Map::orb_ [private]
 

PortableServer::POA_var TAO_Storable_Bindings_Map::poa_ [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 22:17:49 2002 for TAO_CosNaming by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001