AURobotServers
4
|
#include <userverpush.h>
Public Member Functions | |
bool | addPushWatch (UServerPush *obj) |
Add an server push object to watch list. This is called by a combined resource-push object when the object is updated and thus a push command may need triggering. More... | |
void | event () |
virtual bool | executePushFunction (int, UServerInMsg *, void *) |
virtual int | findFunctionOwner (const char *) |
int | getFunctionOwner (UServerInMsg *msg) |
virtual UResBase * | getStaticResource (const char *, bool, bool) |
get a pointer to a static resource. More... | |
virtual bool | isClientAlive (int, double) |
UServerPushImplement () | |
virtual | ~UServerPushImplement () |
Protected Attributes | |
sem_t | actionFlag |
flag to be posted, when an event has happend More... | |
UServerPush * | pushWatch [MAX_PUSH_WATCH_CNT] |
int | pushWatchCnt |
ULock | pushWatchLock |
Base class for a push implement handler
|
inline |
Constructor
References actionFlag, and pushWatchCnt.
|
inlinevirtual |
Constructor
bool UServerPushImplement::addPushWatch | ( | UServerPush * | obj | ) |
Add an server push object to watch list. This is called by a combined resource-push object when the object is updated and thus a push command may need triggering.
obj | is the serverPush object that need to be consulted for pending commands |
References event(), ULock::lock(), MAX_PUSH_WATCH_CNT, pushWatch, pushWatchCnt, pushWatchLock, and ULock::unlock().
Referenced by executePushFunction().
|
inline |
Notifies server that an event has occurred, this may have triggered on-event commands, a call will wake main thread (if idle)
References actionFlag.
Referenced by addPushWatch(), UServerPort::messageReceived(), UCmdExe::postCommand(), and UCmdExe::runIdle().
|
inlinevirtual |
Ececute a push function with this index. The command is in msg, an XML formatted function.
functionIndex | the index returned by findFunctionOwner(tagName) |
msg | The XMK reading structure with the command. |
extra | may be a pointer to a relevant object (laserscan, imega or other object usable by the function) |
Reimplemented in UCmdExe.
References addPushWatch().
|
inlinevirtual |
Service function for push queue - to find index of owner of function described in this tag
Reimplemented in UCmdExe, and UResCron.
References getFunctionOwner().
Referenced by getFunctionOwner().
int UServerPushImplement::getFunctionOwner | ( | UServerInMsg * | msg | ) |
Find index for function, that handles this message, but taking the full XML tag as parameter
References findFunctionOwner(), USmlTagIn::getTagName(), and UServerInMsg::tag.
Referenced by UPush::addPushCommand(), findFunctionOwner(), UCmdExe::handleOneMessageFromQueue(), and UCmdExe::handleServerPushCommand().
|
inlinevirtual |
get a pointer to a static resource.
Get pointer to server Push implement structure (test - fix)
resName | The name of the resource to be acquired. |
mayCreate | if set to true, then the resource will be created if it do not exist. |
staticOnly | get only if a static resource (default). Getting non-static resources may be dangerous of not within same plugin, if not compiled against the same source (headerfilles). |
Reimplemented in UCmdExe.
|
inlinevirtual |
Test to see if client is alive
Reimplemented in UCmdExe.
|
protected |
flag to be posted, when an event has happend
Referenced by event(), UCmdExe::run(), and UServerPushImplement().
|
protected |
Push watch object
Referenced by addPushWatch(), and UCmdExe::run().
|
protected |
Number of watches in store
Referenced by addPushWatch(), UCmdExe::run(), UCmdExe::UCmdExeInit(), and UServerPushImplement().
|
protected |
Lock for watches - as there may be added watched from another thread
Referenced by addPushWatch(), and UCmdExe::run().