28 #ifndef NDN_UTIL_NOTIFICATION_SUBSCRIBER_HPP 29 #define NDN_UTIL_NOTIFICATION_SUBSCRIBER_HPP 54 return m_interestLifetime;
81 time::milliseconds 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;
143 time::milliseconds m_interestLifetime;
150 template<
typename Notification>
154 BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<Notification>));
162 time::milliseconds interestLifetime = 1_min)
175 hasSubscriber()
const override 177 return !onNotification.isEmpty();
181 decodeAndDeliver(
const Data& data)
override 183 Notification notification;
191 onNotification(notification);
199 #endif // NDN_UTIL_NOTIFICATION_SUBSCRIBER_HPP void start()
start or resume receiving notifications
virtual ~NotificationSubscriberBase()
Represents an Interest packet.
provides a lightweight signal / event system
signal::Signal< NotificationSubscriber, Notification > onNotification
fires when a Notification is received
represents a Network Nack
signal::Signal< NotificationSubscriberBase, lp::Nack > onNack
fires when a NACK is received
signal::Signal< NotificationSubscriberBase > onTimeout
fires when no Notification is received within .getInterestLifetime period
Provide a communication channel with local or remote NDN forwarder.
provides a subscriber of Notification Stream
Represents an absolute name.
Generic time-based scheduler.
NotificationSubscriber(Face &face, const Name &prefix, time::milliseconds interestLifetime=1_min)
construct a NotificationSubscriber
Block blockFromValue() const
const Block & getContent() const noexcept
Get the Content element.
time::milliseconds getInterestLifetime() const
signal::Signal< NotificationSubscriberBase, Data > onDecodeError
fires when a Data packet in the Notification Stream cannot be decoded as Notification ...
Represents a Data packet.
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
represents an error in TLV encoding or decoding
NotificationSubscriberBase(Face &face, const Name &prefix, time::milliseconds interestLifetime)
construct a NotificationSubscriber
void stop()
stop receiving notifications