solarpowerlog trunk
CWorkScheduler Class Reference

#include <CWorkScheduler.h>

Collaboration diagram for CWorkScheduler:

List of all members.

Public Member Functions

 CWorkScheduler ()
virtual ~CWorkScheduler ()
void ScheduleWork (ICommand *Command)
void ScheduleWork (ICommand *Commmand, struct timespec ts)
bool DoWork (bool block=false)

Protected Attributes

boost::mutex mut

Friends

class CTimedWork

Detailed Description

This class implements the work scheduler:

Objects derived from CommandTarget can schedule work to be done:

call again later: (when they are not able to complete it immediatly)

call again at .... (when they expect to do some work in some specific time

Warning:
for all actions, the Objects will be passed by reference. At this point of time, CWorkScheduler is owner of the object and will destroy it later, when used.

Definition at line 71 of file CWorkScheduler.h.


Constructor & Destructor Documentation

CWorkScheduler::CWorkScheduler ( )

Definition at line 59 of file CWorkScheduler.cpp.

CWorkScheduler::~CWorkScheduler ( ) [virtual]

Definition at line 68 of file CWorkScheduler.cpp.


Member Function Documentation

bool CWorkScheduler::DoWork ( bool  block = false)

Call this method to do dispatch due work. Note: Returns after each piece of work has been done!

returns true, if work has been done, false, if no work was available.

Parameters:
blockif false (default), it will return if there is no work, else it will wait for work.

Definition at line 73 of file CWorkScheduler.cpp.

Here is the call graph for this function:

void CWorkScheduler::ScheduleWork ( ICommand Command)

Definition at line 98 of file CWorkScheduler.cpp.

void CWorkScheduler::ScheduleWork ( ICommand Commmand,
struct timespec  ts 
)

Schedule a work for later

Definition at line 105 of file CWorkScheduler.cpp.


Friends And Related Function Documentation

friend class CTimedWork [friend]

Definition at line 73 of file CWorkScheduler.h.


Member Data Documentation

boost::mutex CWorkScheduler::mut [protected]

Definition at line 123 of file CWorkScheduler.h.


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