ndn::util::NotificationSubscriber< Notification > Class Template Reference

provides a subscriber of Notification Stream More...

#include <notification-subscriber.hpp>

Inheritance diagram for ndn::util::NotificationSubscriber< Notification >:
[legend]
Collaboration diagram for ndn::util::NotificationSubscriber< Notification >:
[legend]

Public Member Functions

 NotificationSubscriber (Face &face, const Name &prefix, time::milliseconds interestLifetime=time::seconds(60))
 construct a NotificationSubscriber More...
 
time::milliseconds getInterestLifetime () const
 
bool isRunning () const
 
void start ()
 start or resume receiving notifications More...
 
void stop ()
 stop receiving notifications More...
 

Data Fields

 WireDecodable< Notification >
 
signal::Signal< NotificationSubscriber, Notification > onNotification
 fires when a Notification is received More...
 
signal::Signal< NotificationSubscriberBase, lp::NackonNack
 fires when a NACK is received More...
 
signal::Signal< NotificationSubscriberBaseonTimeout
 fires when no Notification is received within .getInterestLifetime period More...
 
signal::Signal< NotificationSubscriberBase, DataonDecodeError
 fires when a Data packet in the Notification Stream cannot be decoded as Notification More...
 

Detailed Description

template<typename Notification>
class ndn::util::NotificationSubscriber< Notification >

provides a subscriber of Notification Stream

See also
https://redmine.named-data.net/projects/nfd/wiki/Notification
Template Parameters
Notificationtype of Notification item, appears in payload of Data packets

Definition at line 170 of file notification-subscriber.hpp.

Constructor & Destructor Documentation

template<typename Notification>
ndn::util::NotificationSubscriber< Notification >::NotificationSubscriber ( Face face,
const Name prefix,
time::milliseconds  interestLifetime = time::seconds(60) 
)
inline

construct a NotificationSubscriber

Note
The subscriber is not started after construction. User should add one or more handlers to onNotification, and invoke .start().

Definition at line 180 of file notification-subscriber.hpp.

Member Function Documentation

time::milliseconds ndn::util::NotificationSubscriberBase::getInterestLifetime ( ) const
inlineinherited
Returns
InterestLifetime of Interests to retrieve notifications

This must be greater than FreshnessPeriod of Notification Data packets, to ensure correct operation of this subscriber implementation.

Definition at line 74 of file notification-subscriber.hpp.

bool ndn::util::NotificationSubscriberBase::isRunning ( ) const
inlineinherited

Definition at line 80 of file notification-subscriber.hpp.

void ndn::util::NotificationSubscriberBase::start ( )
inherited

start or resume receiving notifications

Note
onNotification must have at least one listener, otherwise this operation has no effect.

Definition at line 71 of file notification-subscriber.cpp.

void ndn::util::NotificationSubscriberBase::stop ( )
inherited

stop receiving notifications

Definition at line 81 of file notification-subscriber.cpp.

Field Documentation

signal::Signal<NotificationSubscriberBase, Data> ndn::util::NotificationSubscriberBase::onDecodeError
inherited

fires when a Data packet in the Notification Stream cannot be decoded as Notification

Definition at line 150 of file notification-subscriber.hpp.

signal::Signal<NotificationSubscriberBase, lp::Nack> ndn::util::NotificationSubscriberBase::onNack
inherited

fires when a NACK is received

Definition at line 142 of file notification-subscriber.hpp.

template<typename Notification>
signal::Signal<NotificationSubscriber, Notification> ndn::util::NotificationSubscriber< Notification >::onNotification

fires when a Notification is received

Note
Removing all handlers will cause the subscriber to stop.

Definition at line 190 of file notification-subscriber.hpp.

signal::Signal<NotificationSubscriberBase> ndn::util::NotificationSubscriberBase::onTimeout
inherited

fires when no Notification is received within .getInterestLifetime period

Definition at line 146 of file notification-subscriber.hpp.

template<typename Notification>
ndn::util::NotificationSubscriber< Notification >::WireDecodable< Notification >

Definition at line 174 of file notification-subscriber.hpp.