diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-01 17:53:52 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-01 17:53:52 +0000 |
commit | a436905d622223ee195c02e6b41051ddac15f924 (patch) | |
tree | 3125068f54077a39d92bdca967b28bd0d6bbb2f5 /TAO/tao/Profile.i | |
parent | 83cd476c8218c17ea5766dd00c0c8dc620ec5add (diff) | |
download | ATCD-a436905d622223ee195c02e6b41051ddac15f924.tar.gz |
ChangeLogTag:Wed Sep 1 12:37:25 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Profile.i')
-rw-r--r-- | TAO/tao/Profile.i | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/TAO/tao/Profile.i b/TAO/tao/Profile.i new file mode 100644 index 00000000000..223167c27d5 --- /dev/null +++ b/TAO/tao/Profile.i @@ -0,0 +1,74 @@ +// -*- C++ -*- +// $Id$ + +ACE_INLINE +TAO_Profile::TAO_Profile (CORBA::ULong tag) + : tag_ (tag), + forward_to_ (0), + refcount_ (1) +{ +} + +ACE_INLINE CORBA::ULong +TAO_Profile::tag (void) const +{ + return this->tag_; +} + +ACE_INLINE CORBA::ULong +TAO_Profile::_incr_refcnt (void) +{ + // OK, think I got it. When this object is created (guard) the + // lock is automatically acquired (refcount_lock_). Then when + // we leave this method the destructir for guard is called which + // releases the lock! + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->refcount_lock_, 0); + + return this->refcount_++; +} + +ACE_INLINE CORBA::ULong +TAO_Profile::_decr_refcnt (void) +{ + { + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->refcount_lock_, 0); + this->refcount_--; + if (this->refcount_ != 0) + return this->refcount_; + } + + // refcount is 0, so delete us! + // delete will call our ~ destructor which in turn deletes stuff. + delete this; + return 0; +} + +ACE_INLINE void +TAO_Profile::forward_to (TAO_MProfile *mprofiles) +{ + this->forward_to_ = mprofiles; +} + +ACE_INLINE TAO_MProfile * +TAO_Profile::forward_to (void) +{ + return this->forward_to_; +} + +ACE_INLINE TAO_MProfile * +TAO_Profile::forward_to_i (void) +{ + return this->forward_to_; +} + +ACE_INLINE const TAO_Tagged_Components& +TAO_Profile::tagged_components (void) const +{ + return this->tagged_components_; +} + +ACE_INLINE TAO_Tagged_Components& +TAO_Profile::tagged_components (void) +{ + return this->tagged_components_; +} |