Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
tcJob Class Referenceabstract

The tcJob class is the base class for jobs that get added to the tcPeriodicJobThread. More...

#include <Job.h>

Inheritance diagram for tcJob:
Collaboration diagram for tcJob:

Classes

class  tcStats
 

Public Types

enum  teStatus { eeStopped, eeScheduled, eeRunning, eeFailed }
 

Public Member Functions

 tcJob (const char *apName)
 
virtual ~tcJob ()
 
const char * getName () const
 get the name of the job More...
 
void attachThread (tcPeriodicJobThread *apThread)
 attach this job to a thread More...
 
void detachThread ()
 remove this job from its thread (if attached) More...
 
virtual int getPeriodMs () const
 Get the period of this job (called by thread!) More...
 
virtual uint64 getNextRunTimeMs () const
 
int doExecute ()
 run the job More...
 
virtual teStatus status () const
 get the job status More...
 

Protected Member Functions

virtual int execute ()=0
 run the job More...
 
uint64 timespecToMs (const struct timespec arT) const
 
void enterExecute ()
 convenience function for stats More...
 
void exitExecute ()
 tcJob::exitExecute - called at the end of execute to update stats More...
 

Protected Attributes

tcPeriodicJobThreadmpThread
 thread job will run in More...
 
int mnPeriodMs
 task period (ms) More...
 
uint64 mnLastRunMs
 last run time More...
 
tcStats mcStats
 job status More...
 

Detailed Description

The tcJob class is the base class for jobs that get added to the tcPeriodicJobThread.

Member Enumeration Documentation

◆ teStatus

Enumerator
eeStopped 
eeScheduled 
eeRunning 
eeFailed 

Constructor & Destructor Documentation

◆ tcJob()

tcJob::tcJob ( const char *  apName)

◆ ~tcJob()

tcJob::~tcJob ( )
virtual

Member Function Documentation

◆ attachThread()

void tcJob::attachThread ( tcPeriodicJobThread apThread)

attach this job to a thread

tcJob::attachThread

Parameters
apThread

◆ detachThread()

void tcJob::detachThread ( )

remove this job from its thread (if attached)

tcJob::detachThread remove job from its work thread

◆ doExecute()

int tcJob::doExecute ( )

run the job

doExecute is called by the periodic thread to set up and run execute

◆ enterExecute()

void tcJob::enterExecute ( )
protected

convenience function for stats

tcJob::enterExecute - called at the beginning of execute to update stats

◆ execute()

virtual int tcJob::execute ( )
protectedpure virtual

run the job

Implemented in tcTempMonitorJob.

◆ exitExecute()

void tcJob::exitExecute ( )
protected

tcJob::exitExecute - called at the end of execute to update stats

◆ getName()

const char* tcJob::getName ( ) const
inline

get the name of the job

◆ getNextRunTimeMs()

uint64 tcJob::getNextRunTimeMs ( ) const
virtual

getNetRunTimeMs default implementation returns last run time + period. if never run, just return current time (in ms).

Returns
desired time of next execute.

◆ getPeriodMs()

virtual int tcJob::getPeriodMs ( ) const
inlinevirtual

Get the period of this job (called by thread!)

◆ status()

virtual teStatus tcJob::status ( ) const
inlinevirtual

get the job status

◆ timespecToMs()

uint64 tcJob::timespecToMs ( const struct timespec  arT) const
inlineprotected

Member Data Documentation

◆ mcStats

tcStats tcJob::mcStats
protected

job status

◆ mnLastRunMs

uint64 tcJob::mnLastRunMs
protected

last run time

◆ mnPeriodMs

int tcJob::mnPeriodMs
protected

task period (ms)

◆ mpThread

tcPeriodicJobThread* tcJob::mpThread
protected

thread job will run in


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