live
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
BasicTaskScheduler Class Reference

#include <BasicUsageEnvironment.hh>

Inheritance diagram for BasicTaskScheduler:
Inheritance graph
[legend]
Collaboration diagram for BasicTaskScheduler:
Collaboration graph
[legend]

Public Types

typedef void BackgroundHandlerProc(void *clientData, int mask)
 

Public Member Functions

virtual ~BasicTaskScheduler ()
 
virtual TaskToken scheduleDelayedTask (int64_t microseconds, TaskFunc *proc, void *clientData)
 
virtual void unscheduleDelayedTask (TaskToken &prevTask)
 
virtual void doEventLoop (char volatile *watchVariable)
 
virtual EventTriggerId createEventTrigger (TaskFunc *eventHandlerProc)
 
virtual void deleteEventTrigger (EventTriggerId eventTriggerId)
 
virtual void triggerEvent (EventTriggerId eventTriggerId, void *clientData=NULL)
 
virtual void rescheduleDelayedTask (TaskToken &task, int64_t microseconds, TaskFunc *proc, void *clientData)
 
void disableBackgroundHandling (int socketNum)
 
void turnOnBackgroundReadHandling (int socketNum, BackgroundHandlerProc *handlerProc, void *clientData)
 
void turnOffBackgroundReadHandling (int socketNum)
 
virtual void internalError ()
 

Static Public Member Functions

static BasicTaskSchedulercreateNew (unsigned maxSchedulerGranularity=10000)
 

Protected Member Functions

 BasicTaskScheduler (unsigned maxSchedulerGranularity)
 
void schedulerTickTask ()
 
virtual void SingleStep (unsigned maxDelayTime)
 
virtual void setBackgroundHandling (int socketNum, int conditionSet, BackgroundHandlerProc *handlerProc, void *clientData)
 
virtual void moveSocketHandling (int oldSocketNum, int newSocketNum)
 

Static Protected Member Functions

static void schedulerTickTask (void *clientData)
 

Protected Attributes

unsigned fMaxSchedulerGranularity
 
int fMaxNumSockets
 
fd_set fReadSet
 
fd_set fWriteSet
 
fd_set fExceptionSet
 
intptr_t fTokenCounter
 
DelayQueue fDelayQueue
 
HandlerSetfHandlers
 
int fLastHandledSocketNum
 
std::atomic_flag fTriggersAwaitingHandling [MAX_NUM_EVENT_TRIGGERS]
 
u_int32_t fLastUsedTriggerMask
 
TaskFuncfTriggeredEventHandlers [MAX_NUM_EVENT_TRIGGERS]
 
void * fTriggeredEventClientDatas [MAX_NUM_EVENT_TRIGGERS]
 
unsigned fLastUsedTriggerNum
 
Boolean fEventTriggersAreBeingUsed
 

Detailed Description

Definition at line 47 of file BasicUsageEnvironment.hh.

Member Typedef Documentation

◆ BackgroundHandlerProc

typedef void TaskScheduler::BackgroundHandlerProc(void *clientData, int mask)
inherited

Definition at line 132 of file UsageEnvironment.hh.

Constructor & Destructor Documentation

◆ ~BasicTaskScheduler()

virtual BasicTaskScheduler::~BasicTaskScheduler ( )
virtual

◆ BasicTaskScheduler()

BasicTaskScheduler::BasicTaskScheduler ( unsigned  maxSchedulerGranularity)
protected

Member Function Documentation

◆ createEventTrigger()

virtual EventTriggerId BasicTaskScheduler0::createEventTrigger ( TaskFunc eventHandlerProc)
virtualinherited

Implements TaskScheduler.

◆ createNew()

static BasicTaskScheduler * BasicTaskScheduler::createNew ( unsigned  maxSchedulerGranularity = 10000)
static

◆ deleteEventTrigger()

virtual void BasicTaskScheduler0::deleteEventTrigger ( EventTriggerId  eventTriggerId)
virtualinherited

Implements TaskScheduler.

◆ disableBackgroundHandling()

void TaskScheduler::disableBackgroundHandling ( int  socketNum)
inlineinherited

Definition at line 139 of file UsageEnvironment.hh.

139{ setBackgroundHandling(socketNum, 0, NULL, NULL); }
#define NULL
virtual void setBackgroundHandling(int socketNum, int conditionSet, BackgroundHandlerProc *handlerProc, void *clientData)=0

References NULL, and TaskScheduler::setBackgroundHandling().

Referenced by TaskScheduler::turnOffBackgroundReadHandling().

◆ doEventLoop()

virtual void BasicTaskScheduler0::doEventLoop ( char volatile *  watchVariable)
virtualinherited

Implements TaskScheduler.

◆ internalError()

virtual void TaskScheduler::internalError ( )
virtualinherited

◆ moveSocketHandling()

virtual void BasicTaskScheduler::moveSocketHandling ( int  oldSocketNum,
int  newSocketNum 
)
protectedvirtual

Implements TaskScheduler.

◆ rescheduleDelayedTask()

virtual void TaskScheduler::rescheduleDelayedTask ( TaskToken task,
int64_t  microseconds,
TaskFunc proc,
void *  clientData 
)
virtualinherited

◆ scheduleDelayedTask()

virtual TaskToken BasicTaskScheduler0::scheduleDelayedTask ( int64_t  microseconds,
TaskFunc proc,
void *  clientData 
)
virtualinherited

Implements TaskScheduler.

◆ schedulerTickTask() [1/2]

void BasicTaskScheduler::schedulerTickTask ( )
protected

◆ schedulerTickTask() [2/2]

static void BasicTaskScheduler::schedulerTickTask ( void *  clientData)
staticprotected

◆ setBackgroundHandling()

virtual void BasicTaskScheduler::setBackgroundHandling ( int  socketNum,
int  conditionSet,
BackgroundHandlerProc handlerProc,
void *  clientData 
)
protectedvirtual

Implements TaskScheduler.

◆ SingleStep()

virtual void BasicTaskScheduler::SingleStep ( unsigned  maxDelayTime)
protectedvirtual

Implements BasicTaskScheduler0.

◆ triggerEvent()

virtual void BasicTaskScheduler0::triggerEvent ( EventTriggerId  eventTriggerId,
void *  clientData = NULL 
)
virtualinherited

Implements TaskScheduler.

◆ turnOffBackgroundReadHandling()

void TaskScheduler::turnOffBackgroundReadHandling ( int  socketNum)
inlineinherited

Definition at line 168 of file UsageEnvironment.hh.

168{ disableBackgroundHandling(socketNum); }
void disableBackgroundHandling(int socketNum)

References TaskScheduler::disableBackgroundHandling().

◆ turnOnBackgroundReadHandling()

void TaskScheduler::turnOnBackgroundReadHandling ( int  socketNum,
BackgroundHandlerProc handlerProc,
void *  clientData 
)
inlineinherited

Definition at line 165 of file UsageEnvironment.hh.

165 {
166 setBackgroundHandling(socketNum, SOCKET_READABLE, handlerProc, clientData);
167 }
#define SOCKET_READABLE

References TaskScheduler::setBackgroundHandling(), and SOCKET_READABLE.

◆ unscheduleDelayedTask()

virtual void BasicTaskScheduler0::unscheduleDelayedTask ( TaskToken prevTask)
virtualinherited

Implements TaskScheduler.

Field Documentation

◆ fDelayQueue

DelayQueue BasicTaskScheduler0::fDelayQueue
protectedinherited

Definition at line 112 of file BasicUsageEnvironment0.hh.

◆ fEventTriggersAreBeingUsed

Boolean BasicTaskScheduler0::fEventTriggersAreBeingUsed
protectedinherited

Definition at line 128 of file BasicUsageEnvironment0.hh.

◆ fExceptionSet

fd_set BasicTaskScheduler::fExceptionSet
protected

Definition at line 77 of file BasicUsageEnvironment.hh.

◆ fHandlers

HandlerSet* BasicTaskScheduler0::fHandlers
protectedinherited

Definition at line 115 of file BasicUsageEnvironment0.hh.

◆ fLastHandledSocketNum

int BasicTaskScheduler0::fLastHandledSocketNum
protectedinherited

Definition at line 116 of file BasicUsageEnvironment0.hh.

◆ fLastUsedTriggerMask

u_int32_t BasicTaskScheduler0::fLastUsedTriggerMask
protectedinherited

Definition at line 124 of file BasicUsageEnvironment0.hh.

◆ fLastUsedTriggerNum

unsigned BasicTaskScheduler0::fLastUsedTriggerNum
protectedinherited

Definition at line 127 of file BasicUsageEnvironment0.hh.

◆ fMaxNumSockets

int BasicTaskScheduler::fMaxNumSockets
protected

Definition at line 74 of file BasicUsageEnvironment.hh.

◆ fMaxSchedulerGranularity

unsigned BasicTaskScheduler::fMaxSchedulerGranularity
protected

Definition at line 71 of file BasicUsageEnvironment.hh.

◆ fReadSet

fd_set BasicTaskScheduler::fReadSet
protected

Definition at line 75 of file BasicUsageEnvironment.hh.

◆ fTokenCounter

intptr_t BasicTaskScheduler0::fTokenCounter
protectedinherited

Definition at line 111 of file BasicUsageEnvironment0.hh.

◆ fTriggeredEventClientDatas

void* BasicTaskScheduler0::fTriggeredEventClientDatas[MAX_NUM_EVENT_TRIGGERS]
protectedinherited

Definition at line 126 of file BasicUsageEnvironment0.hh.

◆ fTriggeredEventHandlers

TaskFunc* BasicTaskScheduler0::fTriggeredEventHandlers[MAX_NUM_EVENT_TRIGGERS]
protectedinherited

Definition at line 125 of file BasicUsageEnvironment0.hh.

◆ fTriggersAwaitingHandling

std::atomic_flag BasicTaskScheduler0::fTriggersAwaitingHandling[MAX_NUM_EVENT_TRIGGERS]
protectedinherited

Definition at line 120 of file BasicUsageEnvironment0.hh.

◆ fWriteSet

fd_set BasicTaskScheduler::fWriteSet
protected

Definition at line 76 of file BasicUsageEnvironment.hh.


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