diff options
author | Mark Spruiell <mes@zeroc.com> | 2016-01-19 16:46:11 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2016-01-19 16:46:11 -0800 |
commit | d5dd7c866e9e1dc59dc7e127eb39f641530bf823 (patch) | |
tree | 61771e4f322a7138b643d5325a6d10acea30fb84 /cpp/src/Ice/Buffer.cpp | |
parent | Deprecate ice_name and add ice_id (diff) | |
download | ice-d5dd7c866e9e1dc59dc7e127eb39f641530bf823.tar.bz2 ice-d5dd7c866e9e1dc59dc7e127eb39f641530bf823.tar.xz ice-d5dd7c866e9e1dc59dc7e127eb39f641530bf823.zip |
ICE-6861 - removing public stream API
Diffstat (limited to 'cpp/src/Ice/Buffer.cpp')
-rw-r--r-- | cpp/src/Ice/Buffer.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cpp/src/Ice/Buffer.cpp b/cpp/src/Ice/Buffer.cpp index 8f29d39b6a6..b906c99ae74 100644 --- a/cpp/src/Ice/Buffer.cpp +++ b/cpp/src/Ice/Buffer.cpp @@ -37,6 +37,45 @@ IceInternal::Buffer::Container::Container(const_iterator beg, const_iterator end { } +IceInternal::Buffer::Container::Container(const vector<value_type>& v) : + _capacity(0), + _shrinkCounter(0) +{ + if(v.empty()) + { + _buf = 0; + _size = 0; + } + else + { + _buf = const_cast<value_type*>(&v[0]); + _size = v.size(); + } +} + +IceInternal::Buffer::Container::Container(Container& other, bool adopt) +{ + if(adopt) + { + _buf = other._buf; + _size = other._size; + _capacity = other._capacity; + _shrinkCounter = other._shrinkCounter; + + other._buf = 0; + other._size = 0; + other._capacity = 0; + other._shrinkCounter = 0; + } + else + { + _buf = other._buf; + _size = other._size; + _capacity = 0; + _shrinkCounter = 0; + } +} + IceInternal::Buffer::Container::~Container() { if(_buf && _capacity > 0) |