From 9d0002e5cb97d939f2f74ab1e635b616d634e7db Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Wed, 20 Feb 2019 14:32:42 +0100 Subject: [HICN-73] Performance improvements of interest/data transmission and reception at low level in the stack (portal.h) Change-Id: I1525726f52040f1609e284bb9b995ea8794c5d5e Signed-off-by: Mauro Sardara --- .../src/hicn/transport/core/pending_interest.cc | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'libtransport/src/hicn/transport/core/pending_interest.cc') diff --git a/libtransport/src/hicn/transport/core/pending_interest.cc b/libtransport/src/hicn/transport/core/pending_interest.cc index 73bc41e87..dbbd2c83e 100644 --- a/libtransport/src/hicn/transport/core/pending_interest.cc +++ b/libtransport/src/hicn/transport/core/pending_interest.cc @@ -23,36 +23,31 @@ PendingInterest::PendingInterest() : interest_(nullptr, nullptr), timer_(), on_content_object_callback_(), - on_interest_timeout_callback_(), - received_(false) {} + on_interest_timeout_callback_() {} PendingInterest::PendingInterest(Interest::Ptr &&interest, std::unique_ptr &&timer) : interest_(std::move(interest)), timer_(std::move(timer)), on_content_object_callback_(), - on_interest_timeout_callback_(), - received_(false) {} + on_interest_timeout_callback_() {} PendingInterest::PendingInterest( - Interest::Ptr &&interest, const OnContentObjectCallback &&on_content_object, - const OnInterestTimeoutCallback &&on_interest_timeout, + Interest::Ptr &&interest, OnContentObjectCallback &&on_content_object, + OnInterestTimeoutCallback &&on_interest_timeout, std::unique_ptr &&timer) : interest_(std::move(interest)), timer_(std::move(timer)), on_content_object_callback_(std::move(on_content_object)), - on_interest_timeout_callback_(std::move(on_interest_timeout)), - received_(false) {} + on_interest_timeout_callback_(std::move(on_interest_timeout)) {} -PendingInterest::~PendingInterest() { - // timer_.reset(); -} +PendingInterest::~PendingInterest() {} void PendingInterest::cancelTimer() { timer_->cancel(); } -void PendingInterest::setReceived() { received_ = true; } - -bool PendingInterest::isReceived() const { return received_; } +void PendingInterest::setInterest(Interest::Ptr &&interest) { + interest_ = std::move(interest); +} Interest::Ptr &&PendingInterest::getInterest() { return std::move(interest_); } @@ -60,8 +55,8 @@ const OnContentObjectCallback &PendingInterest::getOnDataCallback() const { return on_content_object_callback_; } -void PendingInterest::setOnDataCallback( - const OnContentObjectCallback &on_content_object) { +void PendingInterest::setOnContentObjectCallback( + OnContentObjectCallback &&on_content_object) { PendingInterest::on_content_object_callback_ = on_content_object; } @@ -70,7 +65,7 @@ const OnInterestTimeoutCallback &PendingInterest::getOnTimeoutCallback() const { } void PendingInterest::setOnTimeoutCallback( - const OnInterestTimeoutCallback &on_interest_timeout) { + OnInterestTimeoutCallback &&on_interest_timeout) { PendingInterest::on_interest_timeout_callback_ = on_interest_timeout; } -- cgit 1.2.3-korg