Raytrix Light Field SDK  4.0
Logo
Public Member Functions | List of all members
Rx::LFR::CImageQueue Class Reference

Detailed Description

A bounded queue that uses the move semantics and that is thread safe.

Template Parameters
TValueThe value type. This type requires a move constructor and a move assignment operator.

Inherits Rx::LFR::CPimpl< CImageQueue_Impl, Interfaces::EImageQueue::ID >.

Public Member Functions

 CImageQueue ()
 Default constructor. More...
 
 CImageQueue (CImageQueue &&xImageQueue)
 Move constructor. More...
 
 ~CImageQueue ()
 Destructor. More...
 
void Clear ()
 Clears this object to its blank/initial state. More...
 
size_t GetFreeSize () const
 Gets the free size. This is the maximum queue size minus the current queue size. More...
 
CImageQueue_Impl & GetImpl ()
 Gets the non constant implementation. More...
 
const CImageQueue_Impl & GetImpl () const
 Gets the constant implementation. More...
 
void * GetInterface (Interfaces::EImageQueue::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const void * GetInterface (Interfaces::EImageQueue::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
TInterface * GetInterface (Interfaces::EImageQueue::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const TInterface * GetInterface (Interfaces::EImageQueue::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
const size_t & GetMaxQueueSize () const
 Gets the maximum queue size. More...
 
void * GetNotEmptyEventWin32Handle () const
 Gets the windows handle of the not empty event. This can be used in functions like WaitForSingleObject. More...
 
bool GetOverwriteEnabled () const
 Gets the overwrite enabled flag. More...
 
size_t GetSize () const
 Gets the current queue size. More...
 
bool HasInterface (Interfaces::EImageQueue::ID eInterface)
 Queries if this object has the given interface. More...
 
void Initialize (size_t nMaxQueueSize, bool bOverwriteEnabled)
 Sets the maximum queue size and clears the queue. More...
 
bool IsEmpty () const
 Query if this queue is empty. More...
 
bool MoveIn (Rx::CRxImage &&xImage)
 Moves the given image at the end of the queue. This signals the not-empty-event. More...
 
bool MoveOut (Rx::CRxImage &xImage)
 Moves the first image out of the queue. This resets the not-empty-event if the queue is now empty. More...
 
CImageQueueoperator= (CImageQueue &&xImageQueue)
 Move assignment operator. More...
 
bool WaitForNotEmpty (int iMilliseconds=-1) const
 Waits. More...
 

Constructor & Destructor Documentation

Rx::LFR::CImageQueue::CImageQueue ( )

Default constructor.

Rx::LFR::CImageQueue::CImageQueue ( CImageQueue &&  xImageQueue)

Move constructor.

Parameters
xImageQueue[in,out] The native image queue.
Rx::LFR::CImageQueue::~CImageQueue ( )

Destructor.

Member Function Documentation

void Rx::LFR::CImageQueue::Clear ( )

Clears this object to its blank/initial state.

size_t Rx::LFR::CImageQueue::GetFreeSize ( ) const

Gets the free size. This is the maximum queue size minus the current queue size.

Returns
The free size.
CImageQueue_Impl & Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::GetImpl ( )
inlineinherited

Gets the non constant implementation.

Returns
The implementation.
const CImageQueue_Impl & Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::GetImpl ( ) const
inlineinherited

Gets the constant implementation.

Returns
The implementation.
void* Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::GetInterface ( Interfaces::EImageQueue::ID  eInterface)
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
const void* Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::GetInterface ( Interfaces::EImageQueue::ID  eInterface) const
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
TInterface* Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::GetInterface ( Interfaces::EImageQueue::ID  eInterface)
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterfaceThe interface type.
Parameters
eInterfaceThe interface.
Returns
Null if it fails, else the interface.
const TInterface* Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::GetInterface ( Interfaces::EImageQueue::ID  eInterface) const
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterfaceThe interface type.
Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
const size_t& Rx::LFR::CImageQueue::GetMaxQueueSize ( ) const

Gets the maximum queue size.

Returns
The maximum queue size.
void* Rx::LFR::CImageQueue::GetNotEmptyEventWin32Handle ( ) const

Gets the windows handle of the not empty event. This can be used in functions like WaitForSingleObject.

Returns
The not empty event handle.
bool Rx::LFR::CImageQueue::GetOverwriteEnabled ( ) const

Gets the overwrite enabled flag.

Returns
The overwrite enabled flag.
size_t Rx::LFR::CImageQueue::GetSize ( ) const

Gets the current queue size.

Returns
The current queue size.
bool Rx::LFR::CPimpl< CImageQueue_Impl , Interfaces::EImageQueue::ID >::HasInterface ( Interfaces::EImageQueue::ID  eInterface)
inlineinherited

Queries if this object has the given interface.

Parameters
eInterfaceThe interface to query.
Returns
True if this class has the given interface, false if not.
void Rx::LFR::CImageQueue::Initialize ( size_t  nMaxQueueSize,
bool  bOverwriteEnabled 
)

Sets the maximum queue size and clears the queue.

Parameters
nMaxQueueSizeThe maximum queue size.
bOverwriteEnabledTrue to enable overwriting of the oldest queue element if the queue is full on MoveIn.
bool Rx::LFR::CImageQueue::IsEmpty ( ) const

Query if this queue is empty.

Returns
True if empty, false if not.
bool Rx::LFR::CImageQueue::MoveIn ( Rx::CRxImage &&  xImage)

Moves the given image at the end of the queue. This signals the not-empty-event.

Parameters
xImage[in,out] The image to move into the queue. May be invalid after this call.
Returns
True if it succeeds, false if the queue is full and overwrite is disabled.
bool Rx::LFR::CImageQueue::MoveOut ( Rx::CRxImage xImage)

Moves the first image out of the queue. This resets the not-empty-event if the queue is now empty.

Parameters
xImage[out] The first image of the queue.
Returns
True if it succeeds, false if the queue is empty.
CImageQueue& Rx::LFR::CImageQueue::operator= ( CImageQueue &&  xImageQueue)

Move assignment operator.

Parameters
xImageQueue[in,out]The image queue instance.
Returns
The instance.
bool Rx::LFR::CImageQueue::WaitForNotEmpty ( int  iMilliseconds = -1) const

Waits.

Parameters
iMilliseconds(Optional) The maximal waiting time in milliseconds. if iMilliseconds is set to -1 the time is set to infinite.
Returns
True if it succeeds, false if it fails.