AURobotServers
4
|
#include <userverpush.h>
Public Member Functions | |
void | clear () |
void | print (const char *preString) |
const char * | print (const char *preString, char *buff, int buffCnt) |
const char * | printCall (const char *preStr, char *buff, const int buffCnt) |
bool | setCall (const int client, const char *callStr) |
bool | unpackCall () |
bool | update (bool success) |
UServerPushElement () | |
Public Attributes | |
bool | activeCall |
bool | activeCmd |
const char * | callName |
int | countGood |
int | countGoodTarget |
int | countTotal |
int | countTotalTarget |
unsigned int | events |
int | functionIndex |
double | interval |
UTime | nextExeTime |
double | parDouble [MAX_PAR] |
char | parOrder [MAX_PAR+1] |
const char * | parString [MAX_PAR] |
UServerInMsg | toDo |
Static Public Attributes | |
static const int | MAX_PAR = 10 |
ServerPushQueue is a class of commands, that awaits execution
UServerPushElement::UServerPushElement | ( | ) |
void UServerPushElement::clear | ( | void | ) |
Clear to unused value
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), and UCmdExe::handleServerPushCommand().
void UServerPushElement::print | ( | const char * | preString | ) |
Print content of queue element
const char * UServerPushElement::print | ( | const char * | preString, |
char * | buff, | ||
int | buffCnt | ||
) |
Print content of queue element
preStr | is to be put at the start of the buffer, |
buff | is the buffer to print to. |
buffCnt | is the length of the buffer |
const char * UServerPushElement::printCall | ( | const char * | preStr, |
char * | buff, | ||
const int | buffCnt | ||
) |
Print call details to this buffer.
preStr | is to be put at the start of the buffer, |
buff | is the buffer to print to. |
buffCnt | is the length of the buffer |
References bool2str().
Referenced by UFunctionImgPool::handleImageListCommand().
bool UServerPushElement::setCall | ( | const int | client, |
const char * | callStr | ||
) |
set this string as the call to be performed when the event has occured.
client | is the client requested the push call. |
callStr | is the call string with all default parameters, and with mark 's', where event parameter is to be placed. The string may be no longer than 500 chars long (MAX_MESSAGE_LENGTH_TO_CAM). |
References MAX_MESSAGE_LENGTH_TO_CAM, and mini().
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), and UCmdExe::handleServerPushCommand().
bool UServerPushElement::unpackCall | ( | ) |
Unpack call string to name, parameter list and parameter prototypes.
References stringSep().
bool UServerPushElement::update | ( | bool | success | ) |
Update the push event counter and the success counter. It further tests if the counts exceed the specified limit.
success | is the result of the execution of the push command. true if the function is to continue (to be active), or false if this were the last run. |
Referenced by UServerPushQueue::doPushCall(), UServerPush::gotNewData(), UResCron::handleOnePushCmd(), UCmdExe::handleOneServerPushMessage(), and UPush::pushEvent().
bool UServerPushElement::activeCall |
Is function active with a call
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), UServerPushQueue::doPushCall(), UServerPushQueue::getFreeQueueElement(), UServerPushQueue::getNextExeTime(), UServerPushQueue::getNextTimedPushElement(), UServerPushQueue::getPushCmdActiveCnt(), UFunctionImgPool::handleImageListCommand(), UResCron::handleOnePushCmd(), UCmdExe::handleOneServerPushMessage(), UCmdExe::handleServerPushCommand(), and UServerPushQueue::systemQueueflush().
bool UServerPushElement::activeCmd |
Is function active with a cmd
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), UServerPushQueue::getFreeQueueElement(), UServerPushQueue::getNextExeTime(), UServerPushQueue::getNextTimedPushElement(), UServerPushQueue::getPushCmdActiveCnt(), UServerPush::gotNewData(), UFunctionImgPool::handleImageListCommand(), UResCron::handleOnePushCmd(), UCmdExe::handleOneServerPushMessage(), UCmdExe::handleServerPushCommand(), UServerPush::needNewData(), UPush::pushEvent(), and UServerPushQueue::systemQueueflush().
const char* UServerPushElement::callName |
qualified name of method to call - is a pointer to toDoMessage
Referenced by UServerPushQueue::doPushCall().
int UServerPushElement::countGood |
The number of function calls with a 'true' result obtained until now.
int UServerPushElement::countGoodTarget |
The number of function calls with a 'true' result to be executed before completion
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), and UCmdExe::handleServerPushCommand().
int UServerPushElement::countTotal |
The total number of function calls (regardless of result) obtained until now.
Referenced by UFunctionImgPool::handleImageListCommand().
int UServerPushElement::countTotalTarget |
The total number of function calls (regardless of result) to be executed before completion
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), and UCmdExe::handleServerPushCommand().
unsigned int UServerPushElement::events |
Event count is used in event push functions, if not all events are to trigger a push.
Referenced by UServerPush::gotNewData(), and UServerPush::needNewData().
int UServerPushElement::functionIndex |
Index to function to perform the stored function
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), UServerPush::gotNewData(), UCmdExe::handleOneServerPushMessage(), UCmdExe::handleServerPushCommand(), and UPush::pushEvent().
double UServerPushElement::interval |
Interval for execution in decimal seconds.
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), UServerPush::gotNewData(), UFunctionImgPool::handleImageListCommand(), UCmdExe::handleServerPushCommand(), and UServerPush::needNewData().
|
static |
Maximum number of parameters allowed in call
Referenced by UServerPushQueue::doPushCall().
UTime UServerPushElement::nextExeTime |
Next time the function is due for execution
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), UServerPushQueue::getNextExeTime(), UServerPushQueue::getNextTimedPushElement(), and UCmdExe::handleServerPushCommand().
double UServerPushElement::parDouble[MAX_PAR] |
Double sized parameters
Referenced by UServerPushQueue::doPushCall().
char UServerPushElement::parOrder[MAX_PAR+1] |
parameter call type
Referenced by UServerPushQueue::doPushCall().
const char* UServerPushElement::parString[MAX_PAR] |
String parameters for call
Referenced by UServerPushQueue::doPushCall().
UServerInMsg UServerPushElement::toDo |
Command line to execute when time is right
Referenced by UPush::addPushCommand(), UServerPush::addPushCommand(), UServerPushQueue::getNextTimedPushElement(), UServerPush::gotNewData(), UFunctionImgPool::handleImageListCommand(), UResCron::handleOnePushCmd(), UCmdExe::handleOneServerPushMessage(), UCmdExe::handleServerPushCommand(), UServerPush::needNewData(), UPush::pushEvent(), and UServerPushQueue::systemQueueflush().