waterfall  0.2dev
 All Classes Files Functions Variables Enumerations Enumerator Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
RingBuffer2D< T > Class Template Reference

Public Types

typedef T value_type
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef int gen_type
 

Public Member Functions

 RingBuffer2D (int width, int chunkSize)
 
 RingBuffer2D (int width, int chunkSize, int capacity)
 
int getWidth () const
 
int getCapacity () const
 
int getSize () const
 
bool isEmpty () const
 
bool isFull () const
 
void clear ()
 
void resize (int width, int chunkSize, int capacity)
 Resizes the ring buffer, discarding all current data in process.
 
void resize (int capacity)
 
pointer push ()
 
pointer at (int mark)
 
int mark ()
 
int size (int start, int end)
 Returns number of elements (rows) between start and end.
 
int size (int start)
 Returns number of elements (rows) between start and head of the buffer.
 
bool isInRange (int index, int start, int end)
 
int reserve (int start, int end)
 Creates a reservation and returns a handle to it. More...
 
bool freeReservation (int handle)
 Frees a reservation previously created by reserve(). More...
 
bool isDirty (int handle)
 Returns true if the reservation with the specified handle has been written to.
 

Static Public Attributes

static const gen_type GEN_WRAP_HIGH = numeric_limits<gen_type>::max() - (numeric_limits<gen_type>::max() / 4)
 
static const gen_type GEN_WRAP_LOW = numeric_limits<gen_type>::min() - (numeric_limits<gen_type>::min() / 4)
 

Member Function Documentation

template<class T>
bool RingBuffer2D< T >::freeReservation ( int  handle)
inline

Frees a reservation previously created by reserve().

Parameters
handlehandle to the reservation returned by the reserve() method
Note
This method is not thread-safe.
template<class T>
int RingBuffer2D< T >::reserve ( int  start,
int  end 
)
inline

Creates a reservation and returns a handle to it.

Returns
integer handle to the created reservation
Note
This method is not thread-safe.

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