aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn/transport/core/manifest.h
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-02-04 11:06:18 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-03-05 09:56:19 +0000
commit6d7704c1b497341fd6dd3c27e3f64d0db062ccc2 (patch)
tree668c6820653cd84da8474d330d2807a8765f96b5 /libtransport/src/hicn/transport/core/manifest.h
parentca66305af16e2f8d8f271218ea71f132e6c21916 (diff)
[HICN-11] Rework on transport protocols improving components modularity
Change-Id: I6683ec5b494238dc93591c103d25275e89b9f267 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/core/manifest.h')
-rw-r--r--libtransport/src/hicn/transport/core/manifest.h37
1 files changed, 9 insertions, 28 deletions
diff --git a/libtransport/src/hicn/transport/core/manifest.h b/libtransport/src/hicn/transport/core/manifest.h
index 558a96804..9f7dc5984 100644
--- a/libtransport/src/hicn/transport/core/manifest.h
+++ b/libtransport/src/hicn/transport/core/manifest.h
@@ -38,39 +38,28 @@ class Manifest : public Base {
using Encoder = typename FormatTraits::Encoder;
using Decoder = typename FormatTraits::Decoder;
- Manifest()
- : packet_(new Base(HF_INET6_TCP_AH), nullptr),
- encoder_(*packet_),
- decoder_(*packet_) {
+ Manifest(std::size_t signature_size = 0)
+ : Base(HF_INET6_TCP_AH),
+ encoder_(*this, signature_size),
+ decoder_(*this) {
Base::setPayloadType(PayloadType::MANIFEST);
}
- Manifest(const core::Name &name)
- : packet_(new Base(name, HF_INET6_TCP_AH), nullptr),
- encoder_(*packet_),
- decoder_(*packet_) {
- Base::setPayloadType(PayloadType::MANIFEST);
- }
-
- Manifest(typename Base::Ptr &&base)
- : packet_(std::move(base)), encoder_(*packet_), decoder_(*packet_) {
+ Manifest(const core::Name &name, std::size_t signature_size = 0)
+ : Base(name, HF_INET6_TCP_AH),
+ encoder_(*this, signature_size),
+ decoder_(*this) {
Base::setPayloadType(PayloadType::MANIFEST);
}
template <typename T>
Manifest(T &&base)
- : packet_(new Base(std::move<T &&>(base)), nullptr),
- encoder_(*packet_),
- decoder_(*packet_) {
+ : Base(std::forward<T &&>(base)), encoder_(*this), decoder_(*this) {
Base::setPayloadType(PayloadType::MANIFEST);
}
virtual ~Manifest() = default;
- bool operator==(const Manifest &other) {
- return this->packet_ == other.packet_;
- }
-
std::size_t estimateManifestSize(std::size_t additional_entries = 0) {
return static_cast<ManifestImpl &>(*this).estimateManifestSizeImpl(
additional_entries);
@@ -142,15 +131,7 @@ class Manifest : public Base {
return *this;
}
- void setSignatureSize(std::size_t size_bits) {
- Packet::setSignatureSize(size_bits);
- encoder_.update();
- }
-
- typename Base::Ptr &&getPacket() { return std::move(packet_); }
-
protected:
- typename Base::Ptr packet_;
ManifestType manifest_type_;
HashAlgorithm hash_algorithm_;
bool is_last_;