My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::CircularBuffer< type > Class Template Reference

Classes

struct  CircularBufferSlot
 

Public Member Functions

 CircularBuffer (unsigned nFrame)
 
virtual ~CircularBuffer ()
 
type * getFrame (unsigned int id, bool create)
 
type * getNextFrame ()
 
type * dispatchNextFrame ()
 
unsigned int getNframesInQueue ()
 

Protected Attributes

std::vector< struct
CircularBufferSlot
slots_
 
unsigned long nSlot_
 

Constructor & Destructor Documentation

template<class type >
gcp::util::CircularBuffer< type >::CircularBuffer ( unsigned  nFrame)

Constructor.

....................................................................... Constructor

template<class type >
gcp::util::CircularBuffer< type >::~CircularBuffer ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

template<class type >
type * gcp::util::CircularBuffer< type >::dispatchNextFrame ( )

Return a pointer to the next slot to be dispatched to the outside world. Using this method guarantees that the returned pointer will not be modified until the next call to dispatchNextFrame(), since the type object returned is locked until dispatchNextFrame() is called again.

....................................................................... Return a pointer to the next slot to be dispatched to the outside world.

template<class type >
type * gcp::util::CircularBuffer< type >::getFrame ( unsigned int  id,
bool  create 
)

Return a pointer to the frame with the passed id. If no frame with that id exists, and create == true, this call will create it. If no frame with that id exists, and create == false, this call returns NULL.

....................................................................... Return a pointer to a data frame in the buffer. If a slot with the passed id has already been installed, that slot will be returned. If no slots matching the passed id were found, and create == true, the next free slot will be initialized with the passed id, and its pointer returned. Else NULL will be returned if no slot with the passed id was found, and create == false.

template<class type >
type * gcp::util::CircularBuffer< type >::getNextFrame ( )

Return a pointer to the next free data frame in the buffer. Creates a new frame on every call.

....................................................................... Return a pointer to the next available frame in the buffer

template<class type >
unsigned int gcp::util::CircularBuffer< type >::getNframesInQueue ( )

Public method to query how many frames are waiting in the queue.

....................................................................... Public method to query how many frames are waiting in the queue.

Member Data Documentation

template<class type >
unsigned long gcp::util::CircularBuffer< type >::nSlot_
protected

The number of frames in our buffer

template<class type >
std::vector<struct CircularBufferSlot> gcp::util::CircularBuffer< type >::slots_
protected

A vector of slots


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