#include <SubscriptionFilter.h>
Public Member Functions | |
SubscriptionFilter (AbstractDevice &device, Property &property, const rdaData &newFilter, bool useFastUpdate, NotificationThread *pNotificationThread) | |
~SubscriptionFilter () | |
void | addSubscriber (const std::string &cycleSelector, rdaValueChangeListener *subscriber) |
bool | removeSubscriber (const std::string &cycleSelector, rdaValueChangeListener *subscriber, bool &isEmpty, bool &toBeDeleted) |
void | notify (MultiplexingContext &muxContext, RequestType &reqType, std::vector< std::string > &validCS) |
void | doUpdate (MultiplexingContext &muxContext, RequestType &reqType, std::vector< std::string > &validCS) |
Private Attributes | |
NotificationThread * | pNotificationThread_ |
bool | cancelled_ |
A SubscriptionFilter can't be deleted immediately on reception of a monitorOFF because it can be used by a notification thread. Instead it is just marked (in a critical section) to be removed. Since this flag is raised teh notification thread cannot use it anymore. | |
uint32_t | pendingNotification_ |
incremented each time a notification message is posted decremented when the notification message is consumed This is used to manage the deletion of the object. |
Definition at line 108 of file SubscriptionFilter.h.
fesa::SubscriptionFilter::SubscriptionFilter | ( | AbstractDevice & | device, | |
Property & | property, | |||
const rdaData & | newFilter, | |||
bool | useFastUpdate, | |||
NotificationThread * | pNotificationThread | |||
) |
Definition at line 225 of file SubscriptionFilter.cpp.
fesa::SubscriptionFilter::~SubscriptionFilter | ( | ) |
Definition at line 230 of file SubscriptionFilter.cpp.
void fesa::SubscriptionFilter::addSubscriber | ( | const std::string & | cycleSelector, | |
rdaValueChangeListener * | subscriber | |||
) | [virtual] |
Reimplemented from fesa::AbstractSubscriptionFilter.
Definition at line 235 of file SubscriptionFilter.cpp.
References fesa::NotificationThread::getMutex(), fesa::AbstractSubscriptionFilter::listeners_, and pNotificationThread_.
void fesa::SubscriptionFilter::doUpdate | ( | MultiplexingContext & | muxContext, | |
RequestType & | reqType, | |||
std::vector< std::string > & | validCS | |||
) |
Definition at line 326 of file SubscriptionFilter.cpp.
References cancelled_, fesa::AbstractSubscriptionFilter::device_, fesa::AbstractSubscriptionFilter::filter_, fesa::Property::get(), fesa::Property::getDataTimestamp(), fesa::FesaException::getErrorCodeAsLong(), fesa::FesaException::getMessage(), fesa::NotificationThread::getMutex(), fesa::AbstractSubscriptionFilter::listeners_, pendingNotification_, pNotificationThread_, fesa::AbstractSubscriptionFilter::property_, and fesa::AbstractSubscriptionFilter::useFastUpdate_.
Referenced by fesa::NotificationThread::run().
void fesa::SubscriptionFilter::notify | ( | MultiplexingContext & | muxContext, | |
RequestType & | reqType, | |||
std::vector< std::string > & | validCS | |||
) | [virtual] |
Implements fesa::AbstractSubscriptionFilter.
Definition at line 303 of file SubscriptionFilter.cpp.
References fesa::NotificationThread::addNotificationEvent(), fesa::NotificationThread::getMutex(), fesa::AbstractSubscriptionFilter::listeners_, pendingNotification_, and pNotificationThread_.
bool fesa::SubscriptionFilter::removeSubscriber | ( | const std::string & | cycleSelector, | |
rdaValueChangeListener * | subscriber, | |||
bool & | isEmpty, | |||
bool & | toBeDeleted | |||
) | [virtual] |
Reimplemented from fesa::AbstractSubscriptionFilter.
Definition at line 258 of file SubscriptionFilter.cpp.
References cancelled_, fesa::NotificationThread::getMutex(), fesa::AbstractSubscriptionFilter::listeners_, pendingNotification_, pNotificationThread_, and fesa::NotificationThread::removeNotificationEvent().
bool fesa::SubscriptionFilter::cancelled_ [private] |
A SubscriptionFilter can't be deleted immediately on reception of a monitorOFF because it can be used by a notification thread. Instead it is just marked (in a critical section) to be removed. Since this flag is raised teh notification thread cannot use it anymore.
Definition at line 132 of file SubscriptionFilter.h.
Referenced by doUpdate(), and removeSubscriber().
uint32_t fesa::SubscriptionFilter::pendingNotification_ [private] |
incremented each time a notification message is posted decremented when the notification message is consumed This is used to manage the deletion of the object.
Definition at line 139 of file SubscriptionFilter.h.
Referenced by doUpdate(), notify(), and removeSubscriber().
Definition at line 125 of file SubscriptionFilter.h.
Referenced by addSubscriber(), doUpdate(), notify(), and removeSubscriber().