AURobotServers  4
Public Member Functions | List of all members
UServerInQueue Class Reference

#include <userverqueue.h>

Inheritance diagram for UServerInQueue:
Inheritance graph

Public Member Functions

int addMessage (int client, const char *msg, int size, bool raw)
 
const char * list (const char *preStr, char *buff, const int buffCnt, int maxOldElements)
 
void print (const char *preStr)
 
UServerInMsgskipToNextMessage (bool checkForDublicates)
 
 UServerInQueue ()
 
virtual ~UServerInQueue ()
 
- Public Member Functions inherited from UMsgQueue
bool addMessage (unsigned char msg[], int size)
 
bool clear ()
 
bool create (int iElements, int iElementSize)
 
void freeQueue ()
 
int getElements ()
 
int getElementSize ()
 
int getNextOut ()
 
unsigned char * getOutMessageRef ()
 
int getUsedMsgCnt ()
 
bool isEmpty ()
 
bool isFull ()
 
bool isValid ()
 
unsigned char * skipToNextMessage (bool checkForDublicates)
 
 UMsgQueue ()
 
 ~UMsgQueue ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 

Additional Inherited Members

- Protected Member Functions inherited from UMsgQueue
unsigned char * getMsg (int i)
 
- Protected Attributes inherited from UMsgQueue
int elements
 
int elementSize
 
int justIn
 
int nextOut
 
unsigned char ** pMsg
 
bool valid
 

Detailed Description

Message queue for messages from clients

Constructor & Destructor Documentation

UServerInQueue::UServerInQueue ( )

Constructor

References MAX_SOCKET_RECEIVE_QUEUE.

UServerInQueue::~UServerInQueue ( )
virtual

Destructor

Member Function Documentation

int UServerInQueue::addMessage ( int  client,
const char *  msg,
int  size,
bool  raw 
)

Add message

Parameters
clientis index to posting client
msgis the message to pose
sizeis length of message - will be terminated here
rawis false, then assumed to be an XML tag (with or without brackets)
Returns
??

References MAX_MESSAGE_LENGTH_TO_CAM, UServerInMsg::setMessage(), and UServerInMsg::size.

Referenced by UServerClient::gotNewMessage(), and UCmdExe::postCommand().

const char * UServerInQueue::list ( const char *  preStr,
char *  buff,
const int  buffCnt,
int  maxOldElements 
)

List queue elements List all pending elements and a maximum number of old elements

Parameters
preStris a string to print atin the start of the buffer
buffis the buffer to use
buffCntis the maximum length to use of the buffer
maxOldElementsis the maximum number of history elements to list
Returns
a pointer to the buffer.

References UTime::getDecSec(), UServerInMsg::message, mini(), UServerInMsg::print(), UServerInMsg::rxTime, UServerInMsg::size, and UTime::valid.

Referenced by UCmdExe::handleServerCommand().

void UServerInQueue::print ( const char *  preStr)

print buffer information to console

References UServerInMsg::print().

Referenced by UServerPort::print().

UServerInMsg * UServerInQueue::skipToNextMessage ( bool  checkForDublicates)

Get message and remove it from queue. NB! Cheeck for dublicates is not supported yet.

References UMsgQueue::skipToNextMessage().

Referenced by UCmdExe::handleOneMessageFromQueue(), and testServerPort().


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