diff options
-rw-r--r-- | ace/CDR_Stream.cpp | 11 | ||||
-rw-r--r-- | ace/CDR_Stream.h | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp index 9220778588b..aea3198e0dd 100644 --- a/ace/CDR_Stream.cpp +++ b/ace/CDR_Stream.cpp @@ -1039,6 +1039,17 @@ ACE_InputCDR::reset (const ACE_Message_Block* data, } } +void +ACE_InputCDR::steal_from (ACE_InputCDR &cdr) +{ + this->do_byte_swap_ = cdr.do_byte_swap_; + this->start_.data_block (cdr.start_.data_block ()->duplicate ()); + this->start_.rd_ptr (cdr.start_.rd_ptr ()); + this->start_.wr_ptr (cdr.start_.wr_ptr ()); + + cdr.reset_contents (); +} + ACE_Message_Block* ACE_InputCDR::steal_contents (void) { diff --git a/ace/CDR_Stream.h b/ace/CDR_Stream.h index f1e40d00864..95efb66f46a 100644 --- a/ace/CDR_Stream.h +++ b/ace/CDR_Stream.h @@ -732,6 +732,10 @@ public: ACE_Message_Block *steal_contents (void); // Steal the contents from the currect CDR. + void steal_from (ACE_InputCDR &cdr); + // Steal the contents of <cdr> and make a shallow copy into this + // stream. + void reset_contents (void); // Re-initialize the CDR stream, forgetting about the old contents // of the stream and allocating a new buffer (from the allocators). |