diff options
Diffstat (limited to 'libtransport/src/hicn/transport/core/pending_interest.h')
-rw-r--r-- | libtransport/src/hicn/transport/core/pending_interest.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libtransport/src/hicn/transport/core/pending_interest.h b/libtransport/src/hicn/transport/core/pending_interest.h index 3b2442d76..c481cc200 100644 --- a/libtransport/src/hicn/transport/core/pending_interest.h +++ b/libtransport/src/hicn/transport/core/pending_interest.h @@ -46,14 +46,15 @@ class PendingInterest { friend class Portal<RawSocketInterface>; public: + using Ptr = utils::ObjectPool<PendingInterest>::Ptr; PendingInterest(); PendingInterest(Interest::Ptr &&interest, std::unique_ptr<asio::steady_timer> &&timer); PendingInterest(Interest::Ptr &&interest, - const OnContentObjectCallback &&on_content_object, - const OnInterestTimeoutCallback &&on_interest_timeout, + OnContentObjectCallback &&on_content_object, + OnInterestTimeoutCallback &&on_interest_timeout, std::unique_ptr<asio::steady_timer> &&timer); ~PendingInterest(); @@ -62,32 +63,28 @@ class PendingInterest { TRANSPORT_ALWAYS_INLINE void startCountdown(Handler &&cb) { timer_->expires_from_now( std::chrono::milliseconds(interest_->getLifetime())); - timer_->async_wait(cb); + timer_->async_wait(std::forward<Handler &&>(cb)); } void cancelTimer(); - void setReceived(); - - bool isReceived() const; - Interest::Ptr &&getInterest(); + void setInterest(Interest::Ptr &&interest); + const OnContentObjectCallback &getOnDataCallback() const; - void setOnDataCallback(const OnContentObjectCallback &on_content_object); + void setOnContentObjectCallback(OnContentObjectCallback &&on_content_object); const OnInterestTimeoutCallback &getOnTimeoutCallback() const; - void setOnTimeoutCallback( - const OnInterestTimeoutCallback &on_interest_timeout); + void setOnTimeoutCallback(OnInterestTimeoutCallback &&on_interest_timeout); private: Interest::Ptr interest_; std::unique_ptr<asio::steady_timer> timer_; OnContentObjectCallback on_content_object_callback_; OnInterestTimeoutCallback on_interest_timeout_callback_; - bool received_; }; } // end namespace core |