AURobotServers
4
|
#include <urescron.h>
Public Member Functions | |
const char * | getResultStr (char *buff, const int buffCnt) |
int | runJob () |
bool | start () |
UCronJob () | |
~UCronJob () | |
Public Attributes | |
bool | active |
is a command active More... | |
const char * | cmdStr |
command string to be executed More... | |
int | errCnt |
reuse of this job structure More... | |
ULogFile * | jobLog |
logfile for trsults More... | |
double | pipeTime |
end time of command More... | |
int | resInt |
result at close of pipe to command More... | |
char | resStr [MAX_RES_STR_SIZE] |
result string (first part) More... | |
int | reuseCnt |
reuse of this job structure More... | |
bool | stopJob |
stop (a too long) job as soon as possible More... | |
UTime | tStart |
start time of command More... | |
Static Public Attributes | |
static const int | MAX_RES_STR_SIZE = 500 |
length of resultt buffer More... | |
Protected Attributes | |
FILE * | pf |
The pipe file handle for the slot. More... | |
pthread_t | threadHandle |
Class to hold one active bash job, that issues a command and saves result to logfile with timing info.
|
inline |
UCronJob::~UCronJob | ( | ) |
const char * UCronJob::getResultStr | ( | char * | buff, |
const int | buffCnt | ||
) |
Get the reply from the job in this buffer
buff | is the destination buffer |
buffCnt | is the length of the buffer |
References active, cmdStr, UTime::getTimeAsString(), pipeTime, resInt, resStr, and tStart.
Referenced by UResCron::getResultStr(), UCronJob(), and UResCron::UResCron().
int UCronJob::runJob | ( | ) |
Run the cron job
References active, cmdStr, errCnt, UTime::getTimePassed(), jobLog, MAX_RES_STR_SIZE, UTime::now(), pf, pipeTime, resInt, resStr, reuseCnt, stopJob, ULogFile::toLog(), and tStart.
Referenced by startCronJobThread(), and UCronJob().
bool UCronJob::start | ( | ) |
Start a new thread with the job
References active, startCronJobThread(), and threadHandle.
Referenced by UResCron::handleOnePushCmd(), UCronJob(), UResCron::UResCron(), and UResCron::UResCronInit().
bool UCronJob::active |
is a command active
Referenced by UResCron::getActiveCnt(), UResCron::getFreeJob(), getResultStr(), UResCron::getResultStringsCnt(), runJob(), start(), and UCronJob().
const char* UCronJob::cmdStr |
command string to be executed
Referenced by getResultStr(), UResCron::handleOnePushCmd(), runJob(), and UCronJob().
int UCronJob::errCnt |
reuse of this job structure
Referenced by UResCron::getDoneJobsErrCnt(), runJob(), and UCronJob().
ULogFile* UCronJob::jobLog |
logfile for trsults
Referenced by runJob(), UCronJob(), and UResCron::UResCronInit().
|
static |
length of resultt buffer
Referenced by runJob().
|
protected |
The pipe file handle for the slot.
Referenced by runJob(), UCronJob(), and ~UCronJob().
double UCronJob::pipeTime |
end time of command
Referenced by getResultStr(), and runJob().
int UCronJob::resInt |
result at close of pipe to command
Referenced by getResultStr(), runJob(), and UCronJob().
char UCronJob::resStr[MAX_RES_STR_SIZE] |
result string (first part)
Referenced by getResultStr(), and runJob().
int UCronJob::reuseCnt |
reuse of this job structure
Referenced by UResCron::getDoneJobsCnt(), UResCron::getResultStringsCnt(), runJob(), and UCronJob().
bool UCronJob::stopJob |
stop (a too long) job as soon as possible
Referenced by runJob().
|
protected |
Thread handle for job execution.
Referenced by start(), UResCron::start(), and UResCron::stop().
UTime UCronJob::tStart |
start time of command
Referenced by getResultStr(), and runJob().