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

#include <userverpush.h>

Inheritance diagram for UServerPushQueue:
Inheritance graph

Public Member Functions

UServerPushElementget (int index)
 
UServerPushElementgetFreeQueueElement ()
 
UTime getNextExeTime ()
 
UServerPushElementgetNextTimedPushElement ()
 
int getPushCmdActiveCnt (int *cmdCnt, int *callCnt)
 
int getPushCmdCnt ()
 
void print (const char *preString)
 
void print (const char *preString, char *buff, int buffCnt)
 
int systemQueueflush (const int client, const char *attValue)
 
 UServerPushQueue ()
 

Static Public Member Functions

static bool doPushCall (UVarPool *vp, UServerPushElement *pe, const char *value)
 

Private Attributes

UServerPushElement pushCmd [MAX_SERVER_PUSH_CMDS]
 
int pushCmdCnt
 
int pushCmdNext
 

Detailed Description

Queue with server push commands, and parameters to start the push event

Constructor & Destructor Documentation

UServerPushQueue::UServerPushQueue ( )

Constructor

Member Function Documentation

bool UServerPushQueue::doPushCall ( UVarPool vp,
UServerPushElement pe,
const char *  value 
)
static

do the push call called for by this push element. Update the push element after the call.

Parameters
vpis a var pool pointer, either the root or an element in the root tree, to implement the call.
pethe push element to implement call for.
valueis the (optional) event value string to be used in the call
Returns
true if the calle returned 1.0 or 2.0 as value.

References UServerPushElement::activeCall, UVarPool::callGlobal(), UServerPushElement::callName, UServerPushElement::MAX_PAR, UServerPushElement::parDouble, UServerPushElement::parOrder, UServerPushElement::parString, and UServerPushElement::update().

Referenced by UCmdExe::handleOneServerPushMessage().

UServerPushElement* UServerPushQueue::get ( int  index)
inline

Get indexed queue element

Referenced by UFunctionImgPool::handleImageListCommand().

UServerPushElement * UServerPushQueue::getFreeQueueElement ( )

Find first free server push queue element. Returns NULL if no more space in queue

References UServerPushElement::activeCall, UServerPushElement::activeCmd, and MAX_SERVER_PUSH_CMDS.

Referenced by UPush::addPushCommand(), and UCmdExe::handleServerPushCommand().

UTime UServerPushQueue::getNextExeTime ( )

Get next time a job is scheduled to be initiated

Returns
10 seconds into the future if no timed jobs are active, else the earliest due-time is returned (may be earlier than now)

References UServerPushElement::activeCall, UServerPushElement::activeCmd, UServerPushElement::nextExeTime, and UTime::now().

UServerPushElement * UServerPushQueue::getNextTimedPushElement ( )

Get next queued push element that has to be activated. Returns pointer to element or NULL if none is ready for activation

References UServerPushElement::activeCall, UServerPushElement::activeCmd, UServerPushElement::nextExeTime, UTime::Now(), USmlTagIn::reset(), UServerInMsg::tag, and UServerPushElement::toDo.

Referenced by UCmdExe::handleOneServerPushMessage().

int UServerPushQueue::getPushCmdActiveCnt ( int *  cmdCnt,
int *  callCnt 
)

Get number if elements in queue that are active.

Parameters
cmdCntis the count of active push commands
callCntis the count of active call commands
Returns
count of active events - sum of call and cmd events

References UServerPushElement::activeCall, UServerPushElement::activeCmd, and MAX_SERVER_PUSH_CMDS.

Referenced by UFunctionImgPool::handlePoolPushCommand().

int UServerPushQueue::getPushCmdCnt ( )
inline

Get number if elements in queue

Referenced by UFunctionImgPool::handleImageListCommand(), and UPush::pushEvent().

void UServerPushQueue::print ( const char *  preString)

print the active content of the queue

Referenced by UCmdExe::handleServerPushCommand(), UCmdExe::print(), and testPush().

void UServerPushQueue::print ( const char *  preString,
char *  buff,
int  buffCnt 
)

print the active content of the queue to a string buffer

int UServerPushQueue::systemQueueflush ( const int  client,
const char *  attValue 
)

Member Data Documentation

UServerPushElement UServerPushQueue::pushCmd[MAX_SERVER_PUSH_CMDS]
private

Command queue for server push commands

Referenced by UPush::addPushCommand().

int UServerPushQueue::pushCmdCnt
private

Number of used server push commands

int UServerPushQueue::pushCmdNext
private

Next server push command to be tested for pending execution


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