ezEngine  Milestone 7
ezMessageQueue< MetaDataType, AllocatorWrapper > Class Template Reference

#include <MessageQueue.h>

Inheritance diagram for ezMessageQueue< MetaDataType, AllocatorWrapper >:

Public Member Functions

 ezMessageQueue (ezAllocatorBase *pAllocator)
 
 ezMessageQueue (const ezMessageQueue< MetaDataType, AllocatorWrapper > &rhs)
 
 ezMessageQueue (const ezMessageQueueBase< MetaDataType > &rhs)
 
void operator= (const ezMessageQueue< MetaDataType, AllocatorWrapper > &rhs)
 
void operator= (const ezMessageQueueBase< MetaDataType > &rhs)
 
- Public Member Functions inherited from ezMessageQueueBase< MetaDataType >
Entryoperator[] (ezUInt32 uiIndex)
 Returns the element at the given index. Not thread safe.
 
const Entryoperator[] (ezUInt32 uiIndex) const
 Returns the element at the given index. Not thread safe.
 
ezUInt32 GetCount () const
 Returns the number of active elements in the queue.
 
bool IsEmpty () const
 Returns true, if the queue does not contain any elements.
 
void Clear ()
 Destructs all elements and sets the count to zero. Does not deallocate any data.
 
void Reserve (ezUInt32 uiCount)
 Expands the queue so it can at least store the given capacity.
 
void Compact ()
 Tries to compact the array to avoid wasting memory.The resulting capacity is at least 'GetCount' (no elements get removed).
 
void Enqueue (ezMessage *pMessage, const MetaDataType &metaData)
 Enqueues the given message and meta-data. This method is thread safe.
 
bool TryDequeue (ezMessage *&out_pMessage, MetaDataType &out_metaData)
 Dequeues the first element if the queue is not empty and returns true. Returns false if the queue is empty. This method is thread safe.
 
bool TryPeek (ezMessage *&out_pMessage, MetaDataType &out_metaData)
 Gives the first element if the queue is not empty and returns true. Returns false if the queue is empty. This method is thread safe.
 
EntryPeek ()
 Returns the first element in the queue. Not thread safe.
 
void Dequeue ()
 Removes the first element from the queue. Not thread safe.
 
template<typename Comparer >
void Sort (const Comparer &comparer)
 Sort with explicit comparer. Not thread safe.
 
void Acquire ()
 Attempts to acquire an exclusive lock on the queue. Do not use this method directly but use ezLock instead.
 
void Release ()
 Releases a lock that has been previously acquired. Do not use this method directly but use ezLock instead.
 
template<typename Comparer >
EZ_FORCE_INLINE void Sort (const Comparer &comparer)
 

Additional Inherited Members

- Protected Member Functions inherited from ezMessageQueueBase< MetaDataType >
 ezMessageQueueBase (ezAllocatorBase *pAllocator)
 No memory is allocated during construction.
 
 ezMessageQueueBase (const ezMessageQueueBase &rhs, ezAllocatorBase *pAllocator)
 No memory is allocated during construction.
 
 ~ezMessageQueueBase ()
 Destructor.
 
void operator= (const ezMessageQueueBase &rhs)
 Assignment operator.
 

Detailed Description

template<typename MetaDataType, typename AllocatorWrapper = ezDefaultAllocatorWrapper>
class ezMessageQueue< MetaDataType, AllocatorWrapper >

See Also
ezMessageQueueBase

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