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

#include <ureslaserif.h>

Inheritance diagram for UResLaserIf:
Inheritance graph

Public Member Functions

virtual bool methodCall (const char *name, const char *paramOrder, char **strings, const double *pars, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
virtual const char * print (const char *preString, char *buff, int buffCnt)
 
bool setResource (UResBase *resource, bool remove)
 
virtual void snprint (const char *preString, char *buff, int buffCnt)
 
 UResLaserIf ()
 
virtual ~UResLaserIf ()
 
- Public Member Functions inherited from UClientHandler
unsigned long addDataTrap (const char *key, EVENT_CALL onEvent, void *object)
 
bool addFunction (UClientFuncBase *functionHandler, bool remove=false)
 
void closeConnection ()
 
void delDataTrap (unsigned long serial)
 
bool getNamespaceUse ()
 
const char * getServerNamespaceName ()
 
double getServerToLocalTime ()
 
bool isServerToLocalTimeValid ()
 
bool isThreadRunning ()
 
bool openConnection ()
 
void print (const char *preString)
 
void sendPing ()
 
void setHost (const char *host)
 
void setNamespace (const char *toName, const char *attributeString)
 
void setNamespaceLost ()
 
void setNamespaceUse (bool value)
 
void setPort (const int port)
 
void setVerbose (bool value)
 
const char * snprint (const char *preString, char *buff, const int buffCnt)
 
bool start ()
 
void stop (bool andWait)
 
void threadRunLoop ()
 
 UClientHandler ()
 
virtual ~UClientHandler ()
 
- Public Member Functions inherited from UClientPortSml
virtual const char * getSourceName ()
 
 UClientPortSml ()
 
- Public Member Functions inherited from UClientPort
bool blockSend (const char *buffer, int length)
 
void closeConnection ()
 
int getDataFromLine (char *buffer, int bufferSize, int pollTimeoutMs)
 
const char * getHost ()
 
const char * getHostIP ()
 
int getPort ()
 
bool isConnected ()
 
bool isVerbose ()
 
bool sendMsg (const char *message)
 
bool sendWithLock (const char *message)
 
void setHost (const char *toHost)
 
void setPort (int toPort)
 
void setVerbose (bool value)
 
bool tryConnect ()
 
 UClientPort ()
 
virtual ~UClientPort ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 
- Public Member Functions inherited from USmlSource
void allowTagAtStartOfLineOnly ()
 
const char * getErrorBuffer ()
 
virtual int getLineNumber ()
 
virtual int getNBytes (char *buffer, int n, int msTimeout=100)
 
virtual bool getNextTag (USmlTag *tag, int msTimeout=100, USmlTagIn *failEndTag=NULL, char *beforeTagBuffer=NULL, int *beforeTagCnt=NULL)
 
char * getRxDataBuffer ()
 
int getRxDataBufferCnt ()
 
bool getToEndTag (USmlTagIn *tag, char *buffer, const int bufferSize, int msTimeout=100, USmlTagIn *lastTag=NULL)
 
bool isErrorText ()
 
bool isVerbose ()
 
virtual bool logSourceData (const char *, int)
 
void setErrorBuffer (char *buf, const int bufCnt)
 
virtual void setLineNumber (int)
 
int setRxDataBufferCnt (int newMaxLength)
 
virtual bool skipNBytes (int n, int msTimeout=100)
 
virtual bool skipToEndTag (USmlTagIn *tag, int msTimeout=100)
 
virtual void syntaxError (const char *message)
 
 USmlSource ()
 
virtual ~USmlSource ()
 
- Public Member Functions inherited from UResVarPool
int addMethod (const char *formalName, const char *paramTypes, const char *comment)
 
int addMethodV (const char *formalName, const char *paramTypes, const char *comment)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (const char *name, const char *initialValue, const char *type, const char *comment)
 
bool callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
bool callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt)
 Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More...
 
bool callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
bool callVS (const char *function, const char *stringParam)
 
int callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys)
 
void createBaseVar ()
 
virtual bool createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false)
 
bool getGlobalString (const char *name, const char **value)
 
bool getGlobalValue (const char *name, double *value)
 
bool getGlobalValue (const char *name, const char **value)
 
bool getGlobalValue (const char *name, bool *value)
 
bool getGlobalValue (const char *name, UTime *value)
 
bool getLocalValue (const char *name, double *value)
 get a value in this variable tree More...
 
bool getLocalValue (const char *name, bool *value)
 
bool getLocalValue (const char *name, UTime *value)
 
double getLocalValue (int idx)
 
UPosition getLocalValue3D (int idx)
 
UPosRot getLocalValue6D (int idx)
 
bool getLocalValueBool (int idx)
 
int getLocalValueInt (int idx)
 
UTime getLocalValueTime (int idx)
 
const char * getLogFileName ()
 
const char * getVarDescription (int idx)
 
UVarCalcgetVarPool ()
 
virtual bool gotAllResources (char *missingThese, int missingTheseCnt)
 
bool isLogFileOpen ()
 
bool isLogFileOpen (const char *structName)
 
bool isVarPoolUpdated (int lastCnt, int *newCnt)
 
void logFileClose ()
 
bool logFileOpen ()
 
void logFileStart (const char *structName, bool open)
 
bool setGlobalVar (const char *name, const double value, bool mayAdd)
 Assigns a value to a variable. The variable may be a part of a structure. More...
 
bool setLocalVar (int idx, double value, const int element)
 
bool setLocalVar (const char *name, const double value, bool mayAdd)
 Assigns a value to a variable. The variable may be a part of a structure. More...
 
bool setLocalVar3D (int idx, UPosition *value)
 
bool setLocalVar6D (int idx, UPosRot *value)
 
bool setLocalVarAdd (int idx, double value, const int element)
 
bool setLocalVarPose (int idx, UPose *value)
 
void setVarPool (UVarCalc *sharedVarPool)
 
int updateQTvars (int structIdx)
 
 UResVarPool ()
 
virtual ~UResVarPool ()
 
- Public Member Functions inherited from UResBase
void createReplayVar (UVarPool *pool)
 
virtual void createResources ()
 
UCmdExegetCorePointer ()
 
char * getLogFileName (char *fn, const int fnCnt)
 
int getResFuncIdx ()
 
const char * getResID ()
 
int getResVersion ()
 
bool isA (const char *idStr)
 
bool isAlsoA (const char *id)
 
virtual void print (const char *preString)
 
virtual void saveSettings ()
 
void setCorePointer (UCmdExe *serverCore)
 
void setResFuncIdx (int idx)
 
virtual void setResID (const char *id, const int version)
 
virtual void stop (bool)
 
virtual void updateReplayStatus ()
 
 UResBase ()
 
virtual ~UResBase ()
 
- Public Member Functions inherited from UReplay
void addChild (UReplay *child)
 
virtual bool decodeReplayLine (char *)
 
char * getLogFileName (char *fn, const int fnCnt)
 
char * getReplayFileName (char *fn, const int fnCnt)
 
int getReplayLogLine ()
 
bool isReplay ()
 
bool isReplayFileOpen ()
 
void removeChild (UReplay *child)
 
virtual void replayAdvanceTime (UTime untilTime)
 
void replaySetBaseFileName (const char *name, const char *preName="")
 
void replaySetFileName (const char *name)
 
virtual bool replayStep ()
 
int replayStep (int steps)
 
virtual bool replayToTime (UTime untilTime)
 
void setParent (UReplay *parent)
 
bool setReplay (bool value)
 
 UReplay ()
 
virtual ~UReplay ()
 
- Public Member Functions inherited from UVarMethodImplement
virtual bool methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt)
 
virtual ~UVarMethodImplement ()
 
- Public Member Functions inherited from UServerPush
int addPushCommand (UServerInMsg *msg)
 
virtual void callGotNewDataWithObject ()
 
bool doPushCall (UServerPushElement *pe, const char *value)
 
void flushClientCmds (int clientIdx)
 
UServerPushImplementgetImplementor ()
 
int getPushCmdCnt (int *cmdCnt, int *callCnt)
 
UServerPushQueuegetPushQueue ()
 
bool gotCmdExe ()
 
void gotNewData (void *pData)
 
bool isUpdated (int lastCnt, int *newCnt)
 
bool needNewData ()
 
void print (const char *preString)
 
void print (const char *preString, char *buff, int buffCnt)
 
void servicePendingPushCmds ()
 
void setCmdExe (UServerPushImplement *executor)
 
void setImplementor (UServerPushImplement *executor)
 
bool setResource (UResBase *resource, bool remove)
 
bool setUpdated (const char *value)
 Add watch object if needed. An image or other object is updated. set object as updated, with an extra qualifier, that may be used as a parameter in a push call. this push list is then added to the to the push list examined by the server thread. when server thread reach this push list it will call to get a possible associated data structure by a call to needNewData() whish is expected to call gotNewData(void * data_structure) - but now in the server thread. More...
 
 UServerPush ()
 
virtual ~UServerPush ()
 

Static Public Member Functions

static const char * getResClassID ()
 
- Static Public Member Functions inherited from UResVarPool
static const char * getResClassID ()
 

Protected Member Functions

void connectionChange (bool connected)
 
void createBaseVar ()
 
- Protected Member Functions inherited from UClientHandler
virtual void interfaceAlive ()
 
virtual void interfaceAliveTag (USmlTag *)
 
virtual void interfaceTick ()
 
void sendNamespaceCloseTag ()
 
virtual void sendNamespaceOpenTag ()
 
- Protected Member Functions inherited from UClientPortSml
virtual bool doVerboseMessages ()
 
virtual int getMoreData (char *buffer, int bufferSize, int pollTimeoutMs)
 
virtual bool isSourceAvailable ()
 
virtual bool outputData (const char *message)
 
- Protected Member Functions inherited from USmlSource
void clearRxBuffer ()
 
- Protected Member Functions inherited from UResVarPool
void setDescription (const char *note, bool copy=false)
 
- Protected Member Functions inherited from UResBase
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 

Additional Inherited Members

- Public Attributes inherited from UClientHandler
bool showInfo
 
bool showWarnings
 
bool tryHoldConnection
 
- Public Attributes inherited from UClientPort
int rxByteCnt
 
ULock tx
 
- Public Attributes inherited from USmlSource
const char * ifName
 
- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 
- Static Public Attributes inherited from UClientHandler
static const int MAX_DATA_TRAPS = 100
 
- Protected Types inherited from UClientPort
enum  { notLost, forReopen, rxError, txError }
 
- Protected Attributes inherited from UClientHandler
bool binData
 is all data binary More...
 
char binTagName [MAX_BIN_NAME_LENGTH+1]
 
char namespaceAttributes [MAX_NORMAL_MESSAGE_LENGTH]
 
char namespaceName [MAX_SML_NAME_LENGTH]
 
bool namespaceUse
 
int notConnectedLoop
 
int rxTimeoutMs
 rx timeout value in ms More...
 
int serverNamespaceLevel
 
char serverNamespaceName [MAX_SML_NAME_LENGTH]
 
bool tryReConnect
 
- Protected Attributes inherited from UClientPort
enum UClientPort:: { ... }  connectionLostReason
 
UTime connectTime
 
char host [MAX_HOST_LENGTH]
 
char hostIP [MAX_HOST_LENGTH]
 
int port
 
unsigned int readCnt
 
bool verboseMessages
 
- Protected Attributes inherited from USmlSource
int dataCnt
 
char * errorBuffer
 
int errorBufferCnt
 
bool gotFirstTag
 
bool tagStartAtStartOfLineOnly
 
- Protected Attributes inherited from UResBase
int resFuncIdx
 
char resID [MAX_RESOURCE_ID_LENGTH]
 
char resIsAlso [MAX_RESOURCE_ISALSO_LENGTH]
 
int resVersion
 
- Protected Attributes inherited from UReplay
bool replay
 
FILE * replayFile
 
char replayFileName [REPLAY_FILE_NAME_LENGTH]
 replay filename More...
 
char replayLine [MAX_LOG_LINE_LENGTH]
 
int replayLogLine
 
UReplayreplayParent
 
UTime replayTimeNext
 
- Static Protected Attributes inherited from UClientHandler
static const int MAX_BIN_NAME_LENGTH = 30
 binary tag name More...
 
- Static Protected Attributes inherited from UReplay
static const int MAX_LOG_LINE_LENGTH = 10000
 
static const int REPLAY_FILE_NAME_LENGTH = 264
 max length of replay filename More...
 

Detailed Description

This is the shared resource class. It must enherit from the resource base class (or one of its decendent) as shown.

Author
Christian Andersen

Constructor & Destructor Documentation

UResLaserIf::UResLaserIf ( )
inline
UResLaserIf::~UResLaserIf ( )
virtual

Destructor

Referenced by UResLaserIf().

Member Function Documentation

void UResLaserIf::connectionChange ( bool  connected)
protectedvirtual

Connection status is changed

Reimplemented from UClientHandler.

References UVariable::b, UResVarPool::getVarPool(), UVarPool::setLocalVar(), and UServerPush::setUpdated().

Referenced by snprint().

void UResLaserIf::createBaseVar ( )
protected

Create the smrif related variables

References UVarPool::addMethod(), UVarPool::addVar(), UResBase::getResVersion(), and UResVarPool::getVarPool().

Referenced by snprint(), and UResLaserIf().

static const char* UResLaserIf::getResClassID ( )
inlinestatic

Fixed name of this resource type

References print().

Referenced by UResLaserIf().

bool UResLaserIf::methodCall ( const char *  name,
const char *  paramOrder,
char **  strings,
const double *  pars,
double *  value,
UDataBase **  returnStruct,
int *  returnStructCnt 
)
virtual

The varPool has methods, and a call to one of these is needed. Do what is needed and return (a double sized) result in 'value' and return true if the method call is allowed. The 'paramOrder' indicates the valid parameters d, s or c for double, string or class that is available as input values for the call. If the returnStruct and returnStructCnt is not NULL, then a number (no more than initial value of returnStructCnt) of structures based on UDataBase may be returned into returnStruct array of pointers. The returnStructCnt should be modified to the actual number of used pointers (if needed).

Reimplemented from UResVarPool.

References UClientPort::sendMsg().

Referenced by snprint().

const char * UResLaserIf::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual

Fixed varsion number for this resource type. Should follow release version, i.e. version 1.28 gives number 128. Should be incremented only when there is change to this class definition, i.e new or changed functions or variables. print status to a string buffer

Reimplemented from UResVarPool.

References UClientHandler::snprint().

Referenced by getResClassID(), and snprint().

bool UResLaserIf::setResource ( UResBase resource,
bool  remove 
)
virtual

Called by server core when new resources are available. return true is resouurce is used Save a pointer to the resource as needed.

Reimplemented from UResVarPool.

References UCmdExe::getResClassID(), UResBase::isAlsoA(), UServerPush::setCmdExe(), and UResVarPool::setResource().

Referenced by snprint().

virtual void UResLaserIf::snprint ( const char *  preString,
char *  buff,
int  buffCnt 
)
inlinevirtual

Print status for this resource

References UClientPort::connected, connectionChange(), createBaseVar(), methodCall(), print(), and setResource().


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