Use argument defaults for getDefaultWireFormat() instead of a separate overloaded method.
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index 5d67f0f..28d753a 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -152,30 +152,18 @@
{
}
- ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const
+ ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const
{
return wireFormat.encodeData(*this);
}
- ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode() const
- {
- return wireEncode(*WireFormat::getDefaultWireFormat());
- }
- void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat)
+ void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat())
{
wireFormat.decodeData(*this, input, inputLength);
}
- void wireDecode(const unsigned char *input, unsigned int inputLength)
- {
- wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
- }
- void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat)
+ void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat())
{
wireDecode(&input[0], input.size(), wireFormat);
}
- void wireDecode(const std::vector<unsigned char>& input)
- {
- wireDecode(&input[0], input.size());
- }
/**
* Set the dataStruct to point to the values in this interest, without copying any memory.