ITK  4.3.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::RingBuffer< TElement > Class Template Reference

#include <itkRingBuffer.h>

+ Inheritance diagram for itk::RingBuffer< TElement >:
+ Collaboration diagram for itk::RingBuffer< TElement >:

Detailed Description

template<class TElement>
class itk::RingBuffer< TElement >

Templated ring buffer for holding anything.

This ring buffer can hold any type of itk class that supports smart pointers. A HEAD pointer is maintained and the buffer pointers can be accessed in order using either positive or negative offsets. The HEAD pointer can also be moved forward or backward in the ring.

Definition at line 39 of file itkRingBuffer.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef ElementType::Pointer ElementPointer
 
typedef TElement ElementType
 
typedef ::itk::OffsetValueType OffsetValueType
 
typedef SmartPointer< SelfPointer
 
typedef RingBuffer Self
 
typedef ::itk::SizeValueType SizeValueType
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

bool BufferIsFull (OffsetValueType offset)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
ElementType::Pointer GetBufferContents (OffsetValueType offset)
 
SizeValueType GetHeadIndex ()
 
virtual const char * GetNameOfClass () const
 
SizeValueType GetNumberOfBuffers ()
 
void MoveHead (OffsetValueType offset)
 
void SetBufferContents (OffsetValueType offset, ElementPointer element)
 
void SetNumberOfBuffers (SizeValueType sz)
 
void MoveHeadForward ()
 
void MoveHeadBackward ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary (void)
 
const MetaDataDictionaryGetMetaDataDictionary (void) const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

OffsetValueType GetOffsetBufferIndex (OffsetValueType offset)
 
 RingBuffer ()
 
virtual ~RingBuffer ()
 
void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Protected Attributes

SizeValueType m_HeadIndex
 
std::vector< ElementPointerm_PointerVector
 

Private Member Functions

void operator= (const Self &)
 
 RingBuffer (const Self &)
 

Additional Inherited Members

- Protected Types inherited from itk::LightObject
typedef int InternalReferenceCountType
 

Member Typedef Documentation

template<class TElement >
typedef SmartPointer< const Self > itk::RingBuffer< TElement >::ConstPointer

Definition at line 49 of file itkRingBuffer.h.

template<class TElement >
typedef ElementType::Pointer itk::RingBuffer< TElement >::ElementPointer

Definition at line 53 of file itkRingBuffer.h.

template<class TElement >
typedef TElement itk::RingBuffer< TElement >::ElementType

Contained type

Definition at line 52 of file itkRingBuffer.h.

template<class TElement >
typedef ::itk::OffsetValueType itk::RingBuffer< TElement >::OffsetValueType

Definition at line 56 of file itkRingBuffer.h.

template<class TElement >
typedef SmartPointer< Self > itk::RingBuffer< TElement >::Pointer

Definition at line 48 of file itkRingBuffer.h.

template<class TElement >
typedef RingBuffer itk::RingBuffer< TElement >::Self

-TYPEDEFS---------------------------------------------------------—— Standard class typedefs

Definition at line 46 of file itkRingBuffer.h.

template<class TElement >
typedef ::itk::SizeValueType itk::RingBuffer< TElement >::SizeValueType

Definition at line 55 of file itkRingBuffer.h.

template<class TElement >
typedef Object itk::RingBuffer< TElement >::Superclass

Definition at line 47 of file itkRingBuffer.h.

Constructor & Destructor Documentation

template<class TElement >
itk::RingBuffer< TElement >::RingBuffer ( )
protected

-PROTECTED METHODS---------------------------------------------------—

template<class TElement >
virtual itk::RingBuffer< TElement >::~RingBuffer ( )
protectedvirtual

-PROTECTED METHODS---------------------------------------------------—

template<class TElement >
itk::RingBuffer< TElement >::RingBuffer ( const Self )
private

Member Function Documentation

template<class TElement >
bool itk::RingBuffer< TElement >::BufferIsFull ( OffsetValueType  offset)

Report whether or not the indicated buffer is full

template<class TElement >
virtual::itk::LightObject::Pointer itk::RingBuffer< TElement >::CreateAnother ( void  ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

template<class TElement >
ElementType::Pointer itk::RingBuffer< TElement >::GetBufferContents ( OffsetValueType  offset)

Access the data from the indicated buffer

template<class TElement >
SizeValueType itk::RingBuffer< TElement >::GetHeadIndex ( )
inline

Report the current position of Head (mostly used for testing)

Definition at line 84 of file itkRingBuffer.h.

template<class TElement >
virtual const char* itk::RingBuffer< TElement >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

template<class TElement >
SizeValueType itk::RingBuffer< TElement >::GetNumberOfBuffers ( )

Get the buffer size

template<class TElement >
OffsetValueType itk::RingBuffer< TElement >::GetOffsetBufferIndex ( OffsetValueType  offset)
protected

Get the proper buffer index from an offset

template<class TElement >
void itk::RingBuffer< TElement >::MoveHead ( OffsetValueType  offset)

Move the Head pointer along the ring using the given offset

template<class TElement >
void itk::RingBuffer< TElement >::MoveHeadBackward ( )

Convenience methods for moving Head +/- 1

template<class TElement >
void itk::RingBuffer< TElement >::MoveHeadForward ( )

Convenience methods for moving Head +/- 1

template<class TElement >
static Pointer itk::RingBuffer< TElement >::New ( )
static

Method for creation through the object factory.

template<class TElement >
void itk::RingBuffer< TElement >::operator= ( const Self )
private
template<class TElement >
void itk::RingBuffer< TElement >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

-PROTECTED METHODS---------------------------------------------------—

Reimplemented from itk::Object.

template<class TElement >
void itk::RingBuffer< TElement >::SetBufferContents ( OffsetValueType  offset,
ElementPointer  element 
)

Set the buffer contents of a buffer

template<class TElement >
void itk::RingBuffer< TElement >::SetNumberOfBuffers ( SizeValueType  sz)

Set the number of buffers WARNING: If the size is set smaller than the current buffer size, the tail of the buffer will be chopped off

Member Data Documentation

template<class TElement >
SizeValueType itk::RingBuffer< TElement >::m_HeadIndex
protected

-PROTECTED MEMBERS------------------------------------------------—— Pointer to the current active buffer

Definition at line 108 of file itkRingBuffer.h.

template<class TElement >
std::vector<ElementPointer> itk::RingBuffer< TElement >::m_PointerVector
protected

Vector of pointers to elements

Definition at line 111 of file itkRingBuffer.h.


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