diff options
Diffstat (limited to 'libtransport/src/hicn/transport/core/pending_interest.cc')
-rw-r--r-- | libtransport/src/hicn/transport/core/pending_interest.cc | 29 |
1 files changed, 12 insertions, 17 deletions
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<asio::steady_timer> &&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<asio::steady_timer> &&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; } |