RaftLib  0.3a
C++ Stream Processing Template Library
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Schedule Class Referenceabstract
Inheritance diagram for Schedule:
[legend]
Collaboration diagram for Schedule:
[legend]

Public Member Functions

 Schedule (Map &map)
 
virtual ~Schedule ()
 
virtual void start ()=0
 
virtual void init ()
 

Static Public Member Functions

static bool isActive (raft::kernel const *const kernel)
 
static void inactivate (raft::kernel *const kernel)
 

Protected Member Functions

virtual bool scheduleKernel (raft::kernel *kernel)
 

Static Protected Member Functions

static raft::kstatus checkSystemSignal (raft::kernel *const kernel, void *data, SystemSignalHandler &handlers)
 
static raft::kstatus quitHandler (FIFO &fifo, raft::kernel *kernel, const raft::signal signal, void *data)
 
static void invalidateOutputPorts (raft::kernel *kernel)
 
static bool kernelHasInputData (raft::kernel *kernel)
 
static bool kernelHasNoInputPorts (raft::kernel *kernel)
 
static void kernelRun (raft::kernel *const kernel, volatile bool &finished)
 

Protected Attributes

SystemSignalHandler handlers
 

Constructor & Destructor Documentation

Schedule::~Schedule ( )
virtual

nothing to do at the moment

Member Function Documentation

raft::kstatus Schedule::checkSystemSignal ( raft::kernel *const  kernel,
void *  data,
SystemSignalHandler handlers 
)
staticprotected

checkSystemSignal - check the incomming streams for the param kernel for any system signals, if there is one then consume the signal and perform the appropriate action.

Parameters
kernel- raft::kernel
data- void*, use this if any further info is needed in future implementations of handlers
Returns
raft::kstatus, proceed unless a stop signal is received

TODO, right now there is special behavior for term signal only, what should we do with others? Need to decide that.

Here is the call graph for this function:

void Schedule::init ( )
virtual

init - call to pre-process all kernels, this function is called by the map object

Here is the call graph for this function:

bool Schedule::kernelHasInputData ( raft::kernel kernel)
staticprotected

kernelHasInputData - check each input port for available data, returns true if any of the input ports has available data.

Parameters
kernel- raft::kernel
Returns
bool - true if input data available.

only output ports, keep calling till exits

Here is the caller graph for this function:

bool Schedule::kernelHasNoInputPorts ( raft::kernel kernel)
staticprotected

kernelHasNoInputPorts - pretty much exactly like the function name says, if the param kernel has no valid input ports (this function assumes that kernelHasInputData() has been called and returns false before this function is called) then it returns true. kernel - raft::kernel*

Returns
bool - true if no valid input ports avail

assume data check is already complete

Here is the caller graph for this function:

void Schedule::kernelRun ( raft::kernel *const  kernel,
volatile bool &  finished 
)
staticprotected

kernelRun - all the logic necessary to run a single kernel successfully. Any additional signal handling should be handled by this function as its the only one that will be universally called by the scheduler.

Parameters
kernel- raft::kernel *const object, non-null kernel
finished- volatile bool - function sets to true when done.

Here is the call graph for this function:

Here is the caller graph for this function:

raft::kstatus Schedule::quitHandler ( FIFO fifo,
raft::kernel kernel,
const raft::signal  signal,
void *  data 
)
staticprotected

quiteHandler - performs the actions needed when a port sends a quite signal (normal termination), this is most likely due to the end of data.

Parameters
fifo- FIFO& that sent the signal
kernel- raft::kernel*
signal- raft::signal
data- void*, vain attempt to future proof

NOTE: This should be the only action needed currently, however that may change in the futre with more features and systems added.

Here is the call graph for this function:

bool Schedule::scheduleKernel ( raft::kernel kernel)
protectedvirtual

scheduleKernel - adds the kernel "kernel" to the schedule, ensures that it is run. Other than that there are no guarantees for its execution. It is purely virtual in its implementation.

Parameters
kernel- raft::kernel*
Returns
bool - returns false if the kernel is already scheduled.

does nothing

Reimplemented in pool_schedule, and simple_schedule.

Here is the caller graph for this function:

virtual void Schedule::start ( )
pure virtual

start - called to start execution of all kernels. Implementation specific so it is purely virtual.

Implemented in pool_schedule, and simple_schedule.

Member Data Documentation

SystemSignalHandler Schedule::handlers
protected

signal handlers


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