[svn] commit: r584 - in /branches/parkinglot/src/lib/dns/cpp: messagerenderer.cc messagerenderer.h

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jan 28 07:49:08 UTC 2010


Author: jinmei
Date: Thu Jan 28 07:49:08 2010
New Revision: 584

Log:
added clear() method

Modified:
    branches/parkinglot/src/lib/dns/cpp/messagerenderer.cc
    branches/parkinglot/src/lib/dns/cpp/messagerenderer.h

Modified: branches/parkinglot/src/lib/dns/cpp/messagerenderer.cc
==============================================================================
--- branches/parkinglot/src/lib/dns/cpp/messagerenderer.cc (original)
+++ branches/parkinglot/src/lib/dns/cpp/messagerenderer.cc Thu Jan 28 07:49:08 2010
@@ -163,6 +163,14 @@
 }
 
 void
+MessageRenderer::clear()
+{
+    impl_->buffer_.clear();
+    impl_->nbuffer_.clear();
+    impl_->nodeset_.clear();
+}
+
+void
 MessageRenderer::writeUint8(uint8_t data)
 {
     impl_->buffer_.writeUint8(data);

Modified: branches/parkinglot/src/lib/dns/cpp/messagerenderer.h
==============================================================================
--- branches/parkinglot/src/lib/dns/cpp/messagerenderer.h (original)
+++ branches/parkinglot/src/lib/dns/cpp/messagerenderer.h Thu Jan 28 07:49:08 2010
@@ -113,6 +113,11 @@
     ///
     /// \param len The length of the gap to be inserted in bytes.
     void skip(size_t len);
+    /// \brief Clear the internal buffer and other internal resources.
+    ///
+    /// This method can be used to re-initialize and reuse the renderer
+    /// without constructing a new one.
+    void clear();
     /// \brief Write an unsigned 8-bit integer into the internal buffer.
     ///
     /// \param data The 8-bit integer to be written into the internal buffer.




More information about the bind10-changes mailing list