Remove support for template<class Msg> boost::shared_ptr<Msg> since we can't typedef a shared_ptr template.
diff --git a/ndn-cpp/common.h b/ndn-cpp/common.h
index 30b705a..2acfd47 100644
--- a/ndn-cpp/common.h
+++ b/ndn-cpp/common.h
@@ -117,83 +117,6 @@
return BytesPtr ();
}
-template<class Msg>
-BytesPtr
-serializeMsg(const Msg &msg)
-{
- int size = msg.ByteSize ();
- BytesPtr bytes (new Bytes (size));
- msg.SerializeToArray (head(*bytes), size);
- return bytes;
-}
-
-template<class Msg>
-boost::shared_ptr<Msg>
-deserializeMsg (const Bytes &bytes)
-{
- boost::shared_ptr<Msg> retval (new Msg ());
- if (!retval->ParseFromArray (head (bytes), bytes.size ()))
- {
- // to indicate an error
- return boost::shared_ptr<Msg> ();
- }
- return retval;
-}
-
-template<class Msg>
-boost::shared_ptr<Msg>
-deserializeMsg (const void *buf, size_t length)
-{
- boost::shared_ptr<Msg> retval (new Msg ());
- if (!retval->ParseFromArray (buf, length))
- {
- // to indicate an error
- return boost::shared_ptr<Msg> ();
- }
- return retval;
-}
-
-
-template<class Msg>
-BytesPtr
-serializeGZipMsg(const Msg &msg)
-{
- std::vector<char> bytes; // Bytes couldn't work
- {
- boost::iostreams::filtering_ostream out;
- out.push(boost::iostreams::gzip_compressor()); // gzip filter
- out.push(boost::iostreams::back_inserter(bytes)); // back_inserter sink
-
- msg.SerializeToOstream(&out);
- }
- BytesPtr uBytes = boost::make_shared<Bytes>(bytes.size());
- memcpy(&(*uBytes)[0], &bytes[0], bytes.size());
- return uBytes;
-}
-
-template<class Msg>
-boost::shared_ptr<Msg>
-deserializeGZipMsg(const Bytes &bytes)
-{
- std::vector<char> sBytes(bytes.size());
- memcpy(&sBytes[0], &bytes[0], bytes.size());
- boost::iostreams::filtering_istream in;
- in.push(boost::iostreams::gzip_decompressor()); // gzip filter
- in.push(boost::make_iterator_range(sBytes)); // source
-
- boost::shared_ptr<Msg> retval = boost::make_shared<Msg>();
- if (!retval->ParseFromIstream(&in))
- {
- // to indicate an error
- return boost::shared_ptr<Msg> ();
- }
-
- return retval;
-}
-
-
-// --- Bytes operations end ---
-
// Exceptions
typedef boost::error_info<struct tag_errmsg, std::string> error_info_str;