28 #ifndef NDN_UTIL_NOTIFICATION_SUBSCRIBER_HPP 29 #define NDN_UTIL_NOTIFICATION_SUBSCRIBER_HPP 31 #include "../face.hpp" 55 return m_interestLifetime;
82 time::milliseconds interestLifetime);
86 sendInitialInterest();
92 hasSubscriber()
const = 0;
101 afterReceiveData(
const Data& data);
107 decodeAndDeliver(
const Data& data) = 0;
110 afterReceiveNack(
const lp::Nack& nack);
135 uint64_t m_lastSequenceNo;
136 uint64_t m_lastNackSequenceNo;
140 const PendingInterestId* m_lastInterestId;
141 time::milliseconds m_interestLifetime;
148 template<
typename Notification>
152 BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<Notification>));
160 time::milliseconds interestLifetime = 1_min)
173 hasSubscriber()
const override 179 decodeAndDeliver(
const Data& data)
override 181 Notification notification;
197 #endif // NDN_UTIL_NOTIFICATION_SUBSCRIBER_HPP void start()
start or resume receiving notifications
Copyright (c) 2011-2015 Regents of the University of California.
virtual ~NotificationSubscriberBase()
const Block & getContent() const
Get Content.
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.
Event that is automatically cancelled upon destruction.
NotificationSubscriber(Face &face, const Name &prefix, time::milliseconds interestLifetime=1_min)
construct a NotificationSubscriber
Block blockFromValue() const
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