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

#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
 

Detailed Description

ServerPushQueue is a class of commands, that awaits execution

Constructor & Destructor Documentation

UServerPushElement::UServerPushElement ( )

Member Function Documentation

void UServerPushElement::clear ( void  )
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

Parameters
preStris to be put at the start of the buffer,
buffis the buffer to print to.
buffCntis the length of the buffer
Returns
pointer to buffer
const char * UServerPushElement::printCall ( const char *  preStr,
char *  buff,
const int  buffCnt 
)

Print call details to this buffer.

Parameters
preStris to be put at the start of the buffer,
buffis the buffer to print to.
buffCntis the length of the buffer
Returns
pointer to 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.

Parameters
clientis the client requested the push call.
callStris 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).
Returns
true if call has valid syntax (do not check all, and not if call is implemented).

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.

Returns
true if call syntax is OK

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.

Parameters
successis 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().

Member Data Documentation

bool UServerPushElement::activeCall
bool UServerPushElement::activeCmd
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
double UServerPushElement::interval
const int UServerPushElement::MAX_PAR = 10
static

Maximum number of parameters allowed in call

Referenced by UServerPushQueue::doPushCall().

UTime UServerPushElement::nextExeTime
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

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