diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-07-05 10:13:48 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-07-05 10:13:48 +0000 |
commit | 01ec2af8ef79521b4279ee7689bd5816939c5b69 (patch) | |
tree | 6de6d7b3e9ab1c1d4fb868c2b2ee431c3d874514 /TAO/tao/Object_Ref_Table.inl | |
parent | 6d36e2d6459e580c42dcc026a10ce55e19b55398 (diff) | |
download | ATCD-01ec2af8ef79521b4279ee7689bd5816939c5b69.tar.gz |
ChangeLogTag:Tue Jul 5 03:07:52 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Object_Ref_Table.inl')
-rw-r--r-- | TAO/tao/Object_Ref_Table.inl | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/TAO/tao/Object_Ref_Table.inl b/TAO/tao/Object_Ref_Table.inl new file mode 100644 index 00000000000..e84bfc38a3b --- /dev/null +++ b/TAO/tao/Object_Ref_Table.inl @@ -0,0 +1,67 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO_Object_Ref_Table::TAO_Object_Ref_Table (void) + : table_ (TAO_DEFAULT_OBJECT_REF_TABLE_SIZE) + , lock_ () +{ +} + +ACE_INLINE void +TAO_Object_Ref_Table::register_initial_reference ( + const char *id, + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL) +{ + if (this->bind (id, obj) != 0) + { + ACE_THROW (CORBA::ORB::InvalidName ()); + } +} + +ACE_INLINE CORBA::Object_ptr +TAO_Object_Ref_Table::resolve_initial_references ( + const char * id + ACE_ENV_ARG_DECL_NOT_USED) +{ + return this->find (id); // Returns a duplicate. +} + +ACE_INLINE void +TAO_Object_Ref_Table::destroy (void) +{ + Table tmp; + + ACE_GUARD (TAO_SYNCH_MUTEX, + guard, + this->lock_); + + this->table_.swap (tmp); // Force release of memory held by our table. +} + +ACE_INLINE TAO_Object_Ref_Table::iterator +TAO_Object_Ref_Table::begin (void) +{ + return this->table_.begin (); +} + +ACE_INLINE TAO_Object_Ref_Table::iterator +TAO_Object_Ref_Table::end (void) +{ + return this->table_.end (); +} + +ACE_INLINE size_t +TAO_Object_Ref_Table::current_size (void) const +{ + return this->table_.size (); +} + +ACE_INLINE int +TAO_Object_Ref_Table::unbind (const char *id) +{ + return + (this->table_.erase (CORBA::String_var (id)) == 0 ? -1 : 0); +} |