NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
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 >:
Collaboration diagram for ndn::util::NotificationSubscriber< Notification >:

Public Member Functions

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

Public Attributes

 WireDecodable< Notification >
 
signal::Signal< NotificationSubscriber, Notification > onNotification
 fires when a Notification is received More...
 
signal::Signal< NotificationSubscriber, lp::NackonNack
 fires when a NACK is received More...
 
signal::Signal< NotificationSubscriberonTimeout
 fires when no Notification is received within .getInterestLifetime period More...
 
signal::Signal< NotificationSubscriber, 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
http://redmine.named-data.net/projects/nfd/wiki/Notification
Template Parameters
Notificationtype of Notification item, appears in payload of Data packets

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

Constructor & Destructor Documentation

◆ NotificationSubscriber()

template<typename Notification>
ndn::util::NotificationSubscriber< Notification >::NotificationSubscriber ( Face face,
const Name prefix,
const time::milliseconds &  interestLifetime = time::milliseconds(60000) 
)
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 78 of file notification-subscriber.hpp.

◆ ~NotificationSubscriber()

template<typename Notification>
virtual ndn::util::NotificationSubscriber< Notification >::~NotificationSubscriber ( )
inlinevirtual

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

Member Function Documentation

◆ getInterestLifetime()

template<typename Notification>
time::milliseconds ndn::util::NotificationSubscriber< Notification >::getInterestLifetime ( ) const
inline
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 102 of file notification-subscriber.hpp.

◆ isRunning()

template<typename Notification>
bool ndn::util::NotificationSubscriber< Notification >::isRunning ( ) const
inline

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

◆ start()

template<typename Notification>
void ndn::util::NotificationSubscriber< Notification >::start ( )
inline

start or resume receiving notifications

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

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

Referenced by nfd::rib::RibManager::registerWithNfd().

◆ stop()

template<typename Notification>
void ndn::util::NotificationSubscriber< Notification >::stop ( )
inline

stop receiving notifications

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

Member Data Documentation

◆ WireDecodable< Notification >

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

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

◆ onNotification

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 145 of file notification-subscriber.hpp.

Referenced by nfd::rib::RibManager::registerWithNfd().

◆ onNack

template<typename Notification>
signal::Signal<NotificationSubscriber, lp::Nack> ndn::util::NotificationSubscriber< Notification >::onNack

fires when a NACK is received

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

◆ onTimeout

template<typename Notification>
signal::Signal<NotificationSubscriber> ndn::util::NotificationSubscriber< Notification >::onTimeout

fires when no Notification is received within .getInterestLifetime period

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

◆ onDecodeError

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

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

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


The documentation for this class was generated from the following file: