AURobotServers
4
|
#include <uprobpolyqueue.h>
Public Member Functions | |
UProbPoly * | lockNextIn () |
UProbPoly * | lockNextOut () |
void | print (const char *preStr) |
void | unlockNextIn (bool valid4Use) |
void | unlockNextOut () |
UProbPolyQueue () | |
virtual | ~UProbPolyQueue () |
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 () | |
Protected Member Functions | |
UProbPoly * | skipToNext () |
Protected Member Functions inherited from UMsgQueue | |
unsigned char * | getMsg (int i) |
Additional Inherited Members | |
Protected Attributes inherited from UMsgQueue | |
int | elements |
int | elementSize |
int | justIn |
int | nextOut |
unsigned char ** | pMsg |
bool | valid |
Queue for incoming free path messages.
UProbPolyQueue::UProbPolyQueue | ( | ) |
Constructor
References UMsgQueue::create(), and MAX_POLYGON_QUEUE_ELEMENTS.
|
virtual |
Destructor
UProbPoly * UProbPolyQueue::lockNextIn | ( | ) |
Gets a pointer to the next free polygon if none is free then the odest will be overwritten. The message is locked on return.
References UMsgQueue::elements, UMsgQueue::getMsg(), UMsgQueue::isFull(), UMsgQueue::justIn, ULock::lock(), UMsgQueue::nextOut, UProbPoly::setValid(), and UMsgQueue::valid.
UProbPoly * UProbPolyQueue::lockNextOut | ( | ) |
Gets a pointer to the next polygon to use of queue is empty a NULL pointer is returned. The queue is locked on return.
References UMsgQueue::isEmpty(), ULock::lock(), skipToNext(), and UMsgQueue::valid.
void UProbPolyQueue::print | ( | const char * | preStr | ) |
print buffer information to console
References UMsgQueue::elements, UMsgQueue::getElements(), UMsgQueue::getElementSize(), UMsgQueue::getMsg(), UMsgQueue::getUsedMsgCnt(), UMsgQueue::isEmpty(), UMsgQueue::justIn, UMsgQueue::nextOut, and UProbPoly::print().
|
protected |
Get oldest element and remove it from queue.
References UMsgQueue::skipToNextMessage().
Referenced by lockNextOut().
void UProbPolyQueue::unlockNextIn | ( | bool | valid4Use | ) |
Unlocks the next message after modifiing the content. if valid4use the message is added to the queue and the in-point is advanced.
References UMsgQueue::elements, UMsgQueue::getMsg(), UMsgQueue::justIn, UProbPoly::setValid(), ULock::unlock(), and UMsgQueue::valid.
void UProbPolyQueue::unlockNextOut | ( | ) |
Unlocks queue after message use
References ULock::unlock().