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
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 .wireDecode 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