fesa-core  7.0.0
fesa::NotificationThread Class Reference

this class is used to notify a subscriber with adjustable priority (always lower, than usual). Each property has a priority level. If that level is lower than the priority's of the server thread, notifications from that property are executed in a NotificationThread. The different NotificationThreads are kept in a Threadpool inside the NotificationThreadFactory. The Notifications of one NotificationThread are stored inside a queue. When the "startConsumption" conditional variable is triggered, the queue will be processed. More...

#include <NotificationThread.h>

Inheritance diagram for fesa::NotificationThread:
fesa::Thread

Public Member Functions

 NotificationThread (const std::string &className, const std::string &notificationThreadKey)
 constructor More...
 
void addNotificationEvent (const boost::shared_ptr< NotificationExporter::NotificationEvent > &notificationEvent)
 
- Public Member Functions inherited from fesa::Thread
virtual ~Thread ()
 Destructor.
 
void setDetachState (int32_t state)
 Modify the detach state of the thread. More...
 
void start (bool blockingMode, const std::string &threadName, bool permanent=true)
 
virtual void stop ()
 Stop the thread.
 
int join (void **status)
 
bool isRunning () const
 Check if the thread is running. More...
 
pthread_t getID () const
 Get the process ID. More...
 
int32_t getPriority () const
 Get the priority of the thread. More...
 
cpu_set_t getAffinity () const
 Get the affinity of the thread.
 
void setPriority (int32_t priority)
 Set the priority of the thread. More...
 
void setAffinity (cpu_set_t affinity)
 Set the affinity of the thread. More...
 
ThreadType getThreadType () const
 

Additional Inherited Members

- Static Public Member Functions inherited from fesa::Thread
static void AdjustProcessScheduling ()
 The process priority can only be adjusted in the main thread. It needs to be adjusted to the maximal thread priority since it sets the limit of the thread priorities of this process. More...
 
static std::string getThreadName (pthread_t threadId)
 Get the name of the thread by its id. More...
 
static std::string getCurrentThreadName ()
 
static void registerThreadIdName (pthread_t threadId, const std::string &threadName)
 Associate a thread id with a name. More...
 
static void registerThreadId (pthread_t threadId, Thread *thread)
 Associate a thread id with a name. More...
 
static Threadcurrent ()
 Returns the Thread object associated with the current thread.
 
static ThreadgetById (pthread_t id)
 Returns the Thread object associated with the given id. Throws FesaException if the id is unknown. More...
 
static const std::set< const
Thread * > 
getThreads ()
 
- Protected Attributes inherited from fesa::Thread
bool isRunning_
 true if the thread is running
 
bool hasFinished_
 true if the thread has finished.
 
bool joinHasFinished_
 if true, a call to pthread_join has completed and a further pthread_cancel / pthread_join call is unsafe
 
bool permanent_
 
pthread_t tid_
 Id of this thread.
 

Detailed Description

this class is used to notify a subscriber with adjustable priority (always lower, than usual). Each property has a priority level. If that level is lower than the priority's of the server thread, notifications from that property are executed in a NotificationThread. The different NotificationThreads are kept in a Threadpool inside the NotificationThreadFactory. The Notifications of one NotificationThread are stored inside a queue. When the "startConsumption" conditional variable is triggered, the queue will be processed.

Constructor & Destructor Documentation

fesa::NotificationThread::NotificationThread ( const std::string &  className,
const std::string &  notificationThreadKey 
)

constructor

Parameters
classNameOnly used to get right thread-prio value
notificationThreadKeyname, which is used to identify the thread

Member Function Documentation

void fesa::NotificationThread::addNotificationEvent ( const boost::shared_ptr< NotificationExporter::NotificationEvent > &  notificationEvent)

Adds a notification to be dispatched.

Parameters
notificationEventthe notification event

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