SOFA API  73d8bb95
Open source framework for multi-physics simuation
sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy > Class Template Reference

#include <CircularQueue.h>

Inheritance diagram for sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >:

Detailed Description

template<class T, template< class U > class StoragePolicy, class ThreadAccessPolicy>
class sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >

This class implements a policy-based circular queue. The template parameter ThreadAccessPolicy allows to customize access to the array according to thread-safety requirements.

Public Member Functions

 CircularQueue ()
 
 ~CircularQueue ()
 
bool push (const T &item)
 
bool pop (T &item, bool clear=true)
 
bool isEmpty () const
 
unsigned size () const
 
bool isFull () const
 
unsigned skip (unsigned maxsize, bool clear=true)
 
template<class OutputIterator >
unsigned pop (OutputIterator out, unsigned maxsize, bool clear=true)
 

Constructor details

template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::CircularQueue ( )
template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::~CircularQueue ( )

Function details

template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
bool sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::isEmpty ( ) const
template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
bool sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::isFull ( ) const
template<class T, template< class U > class StoragePolicy, class ThreadAccessPolicy >
bool sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::pop ( T &  item,
bool  clear = true 
)
template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
template<class OutputIterator >
unsigned sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::pop ( OutputIterator  out,
unsigned  maxsize,
bool  clear = true 
)
template<class T, template< class U > class StoragePolicy, class ThreadAccessPolicy >
bool sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::push ( const T &  item)
template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
unsigned sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::size ( void  ) const
template<class T , template< class U > class StoragePolicy, class ThreadAccessPolicy >
unsigned sofa::helper::system::thread::CircularQueue< T, StoragePolicy, ThreadAccessPolicy >::skip ( unsigned  maxsize,
bool  clear = true 
)