cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mtsQueue< _elementType > Class Template Reference

#include <mtsQueue.h>

Public Types

typedef _elementType value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef size_t size_type
 
typedef size_t index_type
 

Public Member Functions

 mtsQueue (void)
 
 mtsQueue (size_type size, const_reference value)
 
 ~mtsQueue ()
 
void SetSize (size_type size, const_reference value)
 
size_type GetSize (void) const
 
size_type GetAvailable (void) const
 
bool IsFull (void) const
 
bool IsEmpty (void) const
 
const_pointer Put (const typename mtsGenericTypesUnwrap< value_type >::BaseType &newObject)
 
pointer Peek (void) const
 
pointer Get (void)
 

Protected Member Functions

void Allocate (size_type size, const_reference value)
 

Protected Attributes

pointer Data
 
pointer Head
 
pointer Tail
 
pointer Sentinel
 
size_type Size
 

Detailed Description

template<class _elementType>
class mtsQueue< _elementType >

Defines a queue that can be accessed in a thread-safe manner, assuming that there is only one reader and one writer and that pointer updates are atomic.

Member Typedef Documentation

template<class _elementType>
typedef const value_type* mtsQueue< _elementType >::const_pointer
template<class _elementType>
typedef const value_type& mtsQueue< _elementType >::const_reference
template<class _elementType>
typedef size_t mtsQueue< _elementType >::index_type
template<class _elementType>
typedef value_type* mtsQueue< _elementType >::pointer
template<class _elementType>
typedef value_type& mtsQueue< _elementType >::reference
template<class _elementType>
typedef size_t mtsQueue< _elementType >::size_type
template<class _elementType>
typedef _elementType mtsQueue< _elementType >::value_type

Constructor & Destructor Documentation

template<class _elementType>
mtsQueue< _elementType >::mtsQueue ( void  )
inline
template<class _elementType>
mtsQueue< _elementType >::mtsQueue ( size_type  size,
const_reference  value 
)
inline
template<class _elementType>
mtsQueue< _elementType >::~mtsQueue ( )
inline

Member Function Documentation

template<class _elementType>
void mtsQueue< _elementType >::Allocate ( size_type  size,
const_reference  value 
)
inlineprotected
template<class _elementType>
pointer mtsQueue< _elementType >::Get ( void  )
inline

Pop the next object to be read from the queue.

Returns
Pointer to element just popped (use iterator instead?)
template<class _elementType>
size_type mtsQueue< _elementType >::GetAvailable ( void  ) const
inline

Returns number of elements available in queue, i.e. the number of slots used.

template<class _elementType>
size_type mtsQueue< _elementType >::GetSize ( void  ) const
inline

Returns size of queue.

template<class _elementType>
bool mtsQueue< _elementType >::IsEmpty ( void  ) const
inline

Returns true if queue is empty.

template<class _elementType>
bool mtsQueue< _elementType >::IsFull ( void  ) const
inline

Returns true if queue is full.

template<class _elementType>
pointer mtsQueue< _elementType >::Peek ( void  ) const
inline

Get a pointer to the next object to be read, but do not remove the item from the queue.

Returns
Pointer to top element in queue (use iterator instead?)
template<class _elementType>
const_pointer mtsQueue< _elementType >::Put ( const typename mtsGenericTypesUnwrap< value_type >::BaseType &  newObject)
inline

Copy an object to the queue.

Parameters
inreference to the object to be copied
Returns
Pointer to element in queue (use iterator instead?)
template<class _elementType>
void mtsQueue< _elementType >::SetSize ( size_type  size,
const_reference  value 
)
inline

Sets the size of the queue (destructive, i.e. won't preserve previously queued elements).

Member Data Documentation

template<class _elementType>
pointer mtsQueue< _elementType >::Data
protected
template<class _elementType>
pointer mtsQueue< _elementType >::Head
protected
template<class _elementType>
pointer mtsQueue< _elementType >::Sentinel
protected
template<class _elementType>
size_type mtsQueue< _elementType >::Size
protected
template<class _elementType>
pointer mtsQueue< _elementType >::Tail
protected

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