Commit b350749a authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2098] move the MessageRenderer: writeName to the base call as virtual method.

The TreeNodeRRset version will need to use that.
parent 949291a4
......@@ -248,6 +248,9 @@ public:
virtual void setTruncated() {}
virtual void setLengthLimit(size_t) {}
virtual void setCompressMode(CompressMode) {}
virtual void writeName(const LabelSequence&, bool) {
// We don't need this version of writeName
}
// Called for each domain name in the RDATA, from the RDATA's toWire()
// implementation.
......
......@@ -15,6 +15,7 @@
#include <bench/benchmark.h>
#include <dns/name.h>
#include <dns/labelsequence.h>
#include <dns/messagerenderer.h>
#include <oldmessagerenderer.h>
......@@ -115,6 +116,7 @@ public:
virtual void writeName(const Name& name, const bool = false) {
name.toWire(getBuffer());
}
virtual void writeName(const LabelSequence&, const bool) {} // unused
};
void
......
......@@ -15,6 +15,7 @@
#include <exceptions/exceptions.h>
#include <util/buffer.h>
#include <dns/name.h>
#include <dns/labelsequence.h>
#include <oldmessagerenderer.h>
#include <cctype>
......@@ -274,5 +275,10 @@ OldMessageRenderer::writeName(const Name& name, const bool compress) {
}
}
void
OldMessageRenderer::writeName(const LabelSequence&, const bool) {
// we don't use this mode for the benchmark
}
}
}
......@@ -334,6 +334,7 @@ public:
/// \param name A \c Name object to be written.
/// \param compress A boolean indicating whether to enable name compression.
virtual void writeName(const Name& name, bool compress = true) = 0;
virtual void writeName(const LabelSequence& ls, bool compress = true) = 0;
//@}
};
......@@ -391,7 +392,7 @@ public:
///
/// \param ls A \c LabelSequence object to be written.
/// \param compress A boolean indicating whether to enable name compression.
void writeName(const LabelSequence& ls, bool compress = true);
virtual void writeName(const LabelSequence& ls, bool compress = true);
private:
struct MessageRendererImpl;
......
......@@ -81,6 +81,7 @@ public:
virtual void setTruncated() { truncated_ = true; }
virtual void setLengthLimit(size_t len) { length_limit_ = len; }
virtual void setCompressMode(CompressMode mode) { mode_ = mode; }
virtual void writeName(const LabelSequence&, bool) {}
virtual void writeName(const Name& name, bool compress) {
extendData();
const RdataFields::Type field_type =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment