![]() |
MAK RTIspy API Documentation for HLA 1516
|
Very simple wrapper that provides thread-safe access to a basic queue of buffers. More...
Inheritance diagram for DtThreadSafeBufferQueue< T >:
Collaboration diagram for DtThreadSafeBufferQueue< T >:Public Types | |
| typedef std::vector< T > | Buffer |
| typedef std::deque< Buffer * > | BufferQueue |
Public Member Functions | |
| DtThreadSafeBufferQueue (unsigned int initialBufferSize=1000, unsigned int initialBufferCount=10) | |
| Ctor. | |
| virtual | ~DtThreadSafeBufferQueue () |
| Dtor. | |
| virtual void | push (const T *buff, unsigned int size) |
| Push a copy of a T[] of size elements onto the back of the queue. | |
| virtual void | push (Buffer buff) |
| Push a copy of a buffer onto the back of the queue. | |
| virtual std::auto_ptr< Buffer > | pop () |
| Pop the next buffer from the front of the queue Popper assumes ownership of popped buffer. | |
| virtual void | releaseBuffer (std::auto_ptr< Buffer > buff) |
| Return ownership of a buffer to the Queue for re-use. | |
| virtual size_t | size () const |
Protected Attributes | |
| BufferQueue | myQueue |
| Data Members. | |
| BufferQueue | myFreeBuffers |
| MAKRti::DtMutex | myLock |
| Lock for critical section access. | |
Very simple wrapper that provides thread-safe access to a basic queue of buffers.
Queue always makes a complete copy of the pushed buffer. Each buffer element must be copyable. Ownership of popped buffers is assumed by the "popper". Popped buffers may be released to return ownership to the Queue for reuse.
| typedef std::vector<T> DtThreadSafeBufferQueue< T >::Buffer |
| typedef std::deque<Buffer*> DtThreadSafeBufferQueue< T >::BufferQueue |
| DtThreadSafeBufferQueue< T >::DtThreadSafeBufferQueue | ( | unsigned int | initialBufferSize = 1000, |
| unsigned int | initialBufferCount = 10 |
||
| ) |
Ctor.
|
virtual |
Dtor.
|
inlinevirtual |
Pop the next buffer from the front of the queue Popper assumes ownership of popped buffer.
Returns 0 if queue is empty
Referenced by DtExtendedRtiMsgForwarder::getNextMsg().
|
inlinevirtual |
Push a copy of a T[] of size elements onto the back of the queue.
Referenced by DtMessageBufferFilter::doFilter(), DtExtendedRtiMsgForwarder::getNextMsg(), and DtExtendedRtiMsgForwarder::sendMessageToWan().
|
inlinevirtual |
Push a copy of a buffer onto the back of the queue.
|
inlinevirtual |
Return ownership of a buffer to the Queue for re-use.
Referenced by DtExtendedRtiMsgForwarder::getNextMsg().
|
inlinevirtual |
Referenced by DtExtendedRtiMsgForwarder::getNextMsg().
|
protected |
|
mutableprotected |
Lock for critical section access.
|
protected |
Data Members.