28 #ifndef NDN_CXX_UTIL_NOTIFICATION_SUBSCRIBER_HPP
29 #define NDN_CXX_UTIL_NOTIFICATION_SUBSCRIBER_HPP
54 return m_interestLifetime;
85 sendInitialInterest();
91 sendInterest(
const Interest& interest);
94 hasSubscriber()
const = 0;
103 afterReceiveData(
const Data& data);
109 decodeAndDeliver(
const Data& data) = 0;
112 afterReceiveNack(
const lp::Nack& nack);
137 uint64_t m_lastSequenceNum;
138 uint64_t m_lastNackSequenceNum;
150 template<
typename Notification>
154 BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<Notification>));
175 hasSubscriber()
const override
181 decodeAndDeliver(
const Data& data)
override
183 Notification notification;
Block blockFromValue() const
Return a new Block constructed from the TLV-VALUE of this Block.
Represents a Data packet.
const Block & getContent() const noexcept
Get the Content element.
Provide a communication channel with local or remote NDN forwarder.
Represents an Interest packet.
Represents an absolute name.
A concept check for TLV abstraction with a wireDecode(Block) method and constructible from Block.
Represents a Network Nack.
Generic time-based scheduler.
Represents an error in TLV encoding or decoding.
void start()
Start or resume receiving notifications.
signal::Signal< NotificationSubscriberBase, Data > onDecodeError
Fires when a Data packet in the Notification Stream cannot be decoded as Notification.
void stop()
Stop receiving notifications.
virtual ~NotificationSubscriberBase()
time::milliseconds getInterestLifetime() const
signal::Signal< NotificationSubscriberBase > onTimeout
Fires when no Notification is received within getInterestLifetime() period.
NotificationSubscriberBase(Face &face, const Name &prefix, time::milliseconds interestLifetime)
Construct a NotificationSubscriber.
signal::Signal< NotificationSubscriberBase, lp::Nack > onNack
Fires when a Nack is received.
Provides a subscriber of Notification Stream.
NotificationSubscriber(Face &face, const Name &prefix, time::milliseconds interestLifetime=1_min)
Construct a NotificationSubscriber.
signal::Signal< NotificationSubscriber, Notification > onNotification
Fires when a Notification is received.
Provides a lightweight signal / event system.
boost::chrono::milliseconds milliseconds