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

#include <uprobpolyqueue.h>

Inheritance diagram for UProbPolyQueue:
Inheritance graph

Public Member Functions

UProbPolylockNextIn ()
 
UProbPolylockNextOut ()
 
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

UProbPolyskipToNext ()
 
- 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
 

Detailed Description

Queue for incoming free path messages.

Author
Christian Andersen

Constructor & Destructor Documentation

UProbPolyQueue::UProbPolyQueue ( )

Constructor

References UMsgQueue::create(), and MAX_POLYGON_QUEUE_ELEMENTS.

UProbPolyQueue::~UProbPolyQueue ( )
virtual

Destructor

Member Function Documentation

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)
UProbPoly * UProbPolyQueue::skipToNext ( )
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().


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