diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-01-27 05:47:29 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-01-27 05:47:29 +0000 |
commit | 4f06074999efa6ae51339e7affdcf6f56ae9c62c (patch) | |
tree | d2bb41ea8aea4c52c15a825ffbbb024bbd5096e7 /ace/Message_Block.cpp | |
parent | e535899fdc03fb33731ac464cc9968d46cbb2cc1 (diff) | |
download | ATCD-4f06074999efa6ae51339e7affdcf6f56ae9c62c.tar.gz |
Added new methods ::mark(), ::capacity(), ::total_capacity().
::mark points at base_ + cur_size_, capacity_ returns max_size_, and
total_capacity_ sums all capcity()'s for all MBs in the continuation.
Changed ::space() to return ::mark() - ::wr_ptr().
Diffstat (limited to 'ace/Message_Block.cpp')
-rw-r--r-- | ace/Message_Block.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 00d49cd725f..ff5e761ef86 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -250,6 +250,23 @@ ACE_Message_Block::total_length (void) const return length; } +size_t +ACE_Message_Block::total_capacity (void) const +{ + ACE_TRACE ("ACE_Message_Block::total_size"); + + size_t size = 0; + + for (const ACE_Message_Block *i = this; + i != 0; + i = i->cont ()) + { + size += i->capacity (); + } + + return size; +} + ACE_Data_Block::ACE_Data_Block (void) : type_ (ACE_Message_Block::MB_DATA), cur_size_ (0), |