![]() |
MAK RTIspy API Documentation for HLA 1.3
|
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. More... | |
| virtual | ~DtThreadSafeBufferQueue () |
| Dtor. More... | |
| virtual void | push (const T *buff, unsigned int size) |
| Push a copy of a T[] of size elements onto the back of the queue. More... | |
| virtual void | push (Buffer buff) |
| Push a copy of a buffer onto the back of the queue. More... | |
| virtual DtUniquePtr< Buffer > | pop () |
| Pop the next buffer from the front of the queue Popper assumes ownership of popped buffer. More... | |
| virtual void | releaseBuffer (DtUniquePtr< Buffer > buff) |
| Return ownership of a buffer to the Queue for re-use. More... | |
| virtual size_t | size () const |
Protected Attributes | |
| BufferQueue | myQueue |
| Data Members. More... | |
| BufferQueue | myFreeBuffers |
| MAKRti::DtMutex | myLock |
| Lock for critical section access. More... | |
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
|
inlinevirtual |
Push a copy of a T[] of size elements onto the back of the queue.
|
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.
|
inlinevirtual |
|
protected |
|
mutableprotected |
Lock for critical section access.
|
protected |
Data Members.