diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-27 00:25:23 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-27 00:25:23 +0000 |
commit | 6120ebbb2351296f43f6be77ca8d2acede87204a (patch) | |
tree | 15d11034396d9c886c7021605705a7f0370f5d98 /TAO/tao/MProfile.i | |
parent | 457f8b0edf17c7abc57be85dcd78f5974057c01b (diff) | |
download | ATCD-6120ebbb2351296f43f6be77ca8d2acede87204a.tar.gz |
ChangeLogTag:Wed May 26 18:51:39 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/MProfile.i')
-rw-r--r-- | TAO/tao/MProfile.i | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/TAO/tao/MProfile.i b/TAO/tao/MProfile.i index a4291144f82..f9d25df3593 100644 --- a/TAO/tao/MProfile.i +++ b/TAO/tao/MProfile.i @@ -163,6 +163,12 @@ TAO_MProfile::profile_count (void) const return this->last_; } +ACE_INLINE CORBA::ULong +TAO_MProfile::size (void) const +{ + return this->size_; +} + ACE_INLINE const TAO_Profile* TAO_MProfile::get_profile (CORBA::ULong index) const { @@ -176,3 +182,33 @@ TAO_MProfile::pfiles (void) const { return this->pfiles_; } + + +// Not thread safe! +ACE_INLINE int +TAO_MProfile::grow (CORBA::ULong sz) +{ + if (sz <= this->size_) + return 0; + + // get the additional space + TAO_Profile_ptr *new_pfiles, *old_pfiles; + ACE_NEW_RETURN (new_pfiles, + TAO_Profile_ptr[sz], + -1); + + old_pfiles = this->pfiles_; + + // got it, now copy profiles + for (TAO_PHandle h = 0; h < this->size_; ++h) + { + new_pfiles[h] = old_pfiles[h]; + old_pfiles[h] = 0; + } + + this->pfiles_ = new_pfiles; + this->size_ = sz; + delete [] old_pfiles; + + return 0; +} |