AURobotServers  4
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
UCronJob Class Reference

#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...
 
ULogFilejobLog
 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
 

Detailed Description

Class to hold one active bash job, that issues a command and saves result to logfile with timing info.

Constructor & Destructor Documentation

UCronJob::UCronJob ( )
inline
UCronJob::~UCronJob ( )

destructor

References pf.

Referenced by UCronJob().

Member Function Documentation

const char * UCronJob::getResultStr ( char *  buff,
const int  buffCnt 
)

Get the reply from the job in this buffer

Parameters
buffis the destination buffer
buffCntis the length of the buffer
Returns
a pointer to buff

References active, cmdStr, UTime::getTimeAsString(), pipeTime, resInt, resStr, and tStart.

Referenced by UResCron::getResultStr(), UCronJob(), and UResCron::UResCron().

int UCronJob::runJob ( )
bool UCronJob::start ( )

Start a new thread with the job

Returns
true if the thread were started

References active, startCronJobThread(), and threadHandle.

Referenced by UResCron::handleOnePushCmd(), UCronJob(), UResCron::UResCron(), and UResCron::UResCronInit().

Member Data Documentation

bool UCronJob::active
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().

const int UCronJob::MAX_RES_STR_SIZE = 500
static

length of resultt buffer

Referenced by runJob().

FILE* UCronJob::pf
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().

pthread_t UCronJob::threadHandle
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().


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