Browse Source

[2098] some additional changes to making writeName virtual in the base class.

JINMEI Tatuya 12 years ago
parent
commit
2c34181ad7
2 changed files with 14 additions and 16 deletions
  1. 1 0
      src/lib/dns/benchmarks/oldmessagerenderer.h
  2. 13 16
      src/lib/dns/messagerenderer.h

+ 1 - 0
src/lib/dns/benchmarks/oldmessagerenderer.h

@@ -42,6 +42,7 @@ public:
     virtual void setCompressMode(CompressMode mode);
     virtual void setCompressMode(CompressMode mode);
     virtual void clear();
     virtual void clear();
     virtual void writeName(const Name& name, bool compress = true);
     virtual void writeName(const Name& name, bool compress = true);
+    virtual void writeName(const LabelSequence& labels, bool compress);
 private:
 private:
     struct MessageRendererImpl;
     struct MessageRendererImpl;
     MessageRendererImpl* impl_;
     MessageRendererImpl* impl_;

+ 13 - 16
src/lib/dns/messagerenderer.h

@@ -332,8 +332,20 @@ public:
     /// for compressing subsequent names.
     /// for compressing subsequent names.
     ///
     ///
     /// \param name A \c Name object to be written.
     /// \param name A \c Name object to be written.
-    /// \param compress A boolean indicating whether to enable name compression.
+    /// \param compress A boolean indicating whether to enable name
+    /// compression.
     virtual void writeName(const Name& name, bool compress = true) = 0;
     virtual void writeName(const Name& name, bool compress = true) = 0;
+
+    /// \brief Write a \c LabelSequence object into the internal buffer
+    /// in wire format, with or without name compression.
+    ///
+    /// This is the same as the other version, which takes \c Name instead
+    /// of \c LabelSequence, except for the parameter type.  The passed
+    /// \c LabelSequence must be absolute.
+    ///
+    /// \param ls A \c LabelSequence object to be written.
+    /// \param compress A boolean indicating whether to enable name
+    /// compression.
     virtual void writeName(const LabelSequence& ls, bool compress = true) = 0;
     virtual void writeName(const LabelSequence& ls, bool compress = true) = 0;
     //@}
     //@}
 };
 };
@@ -377,21 +389,6 @@ public:
 
 
     virtual void clear();
     virtual void clear();
     virtual void writeName(const Name& name, bool compress = true);
     virtual void writeName(const Name& name, bool compress = true);
-
-    /// \brief Write a \c LabelSequence object into the internal buffer
-    /// in wire format, with or without name compression.
-    ///
-    /// If the optional parameter \c compress is \c true, this method tries to
-    /// compress the \c ls if possible, searching the entire message that has
-    /// been rendered.  Otherwise name compression is omitted.  Its default
-    /// value is \c true.
-    ///
-    /// Note: even if \c compress is \c true, the position of the \c ls (and
-    /// possibly its ancestor names) in the message is recorded and may be used
-    /// for compressing subsequent names.
-    ///
-    /// \param ls A \c LabelSequence object to be written.
-    /// \param compress A boolean indicating whether to enable name compression.
     virtual void writeName(const LabelSequence& ls, bool compress = true);
     virtual void writeName(const LabelSequence& ls, bool compress = true);
 
 
 private:
 private: