ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Static Public 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 >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using ElementPointer = typename ElementType::Pointer
 
using ElementType = TElement
 
using OffsetValueType = ::itk::OffsetValueType
 
using Pointer = SmartPointer< Self >
 
using Self = RingBuffer
 
using SizeValueType = ::itk::SizeValueType
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const char * GetNameOfClass () const
 
SizeValueType GetNumberOfBuffers ()
 
void MoveHead (OffsetValueType offset)
 
void SetNumberOfBuffers (SizeValueType n)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () 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
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
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 val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
SizeValueType m_HeadIndex { 0 }
 
std::vector< ElementPointerm_PointerVector
 
void MoveHeadForward ()
 
void MoveHeadBackward ()
 
bool BufferIsFull (OffsetValueType offset)
 
SizeValueType GetHeadIndex ()
 
ElementType::Pointer GetBufferContents (OffsetValueType offset)
 
void SetBufferContents (OffsetValueType offset, ElementPointer element)
 
 RingBuffer ()
 
 ~RingBuffer () override=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
OffsetValueType GetOffsetBufferIndex (OffsetValueType offset)
 

Additional Inherited Members

- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
- 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 inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

template<typename 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 40 of file itkRingBuffer.h.

Member Typedef Documentation

◆ ConstPointer

template<typename TElement >
using itk::RingBuffer< TElement >::ConstPointer = SmartPointer<const Self>

Definition at line 51 of file itkRingBuffer.h.

◆ ElementPointer

template<typename TElement >
using itk::RingBuffer< TElement >::ElementPointer = typename ElementType::Pointer

Definition at line 55 of file itkRingBuffer.h.

◆ ElementType

template<typename TElement >
using itk::RingBuffer< TElement >::ElementType = TElement

Contained type

Definition at line 54 of file itkRingBuffer.h.

◆ OffsetValueType

template<typename TElement >
using itk::RingBuffer< TElement >::OffsetValueType = ::itk::OffsetValueType

Definition at line 58 of file itkRingBuffer.h.

◆ Pointer

template<typename TElement >
using itk::RingBuffer< TElement >::Pointer = SmartPointer<Self>

Definition at line 50 of file itkRingBuffer.h.

◆ Self

template<typename TElement >
using itk::RingBuffer< TElement >::Self = RingBuffer

-TYPEDEFS------------------------------------------------------------— Standard class type aliases

Definition at line 48 of file itkRingBuffer.h.

◆ SizeValueType

template<typename TElement >
using itk::RingBuffer< TElement >::SizeValueType = ::itk::SizeValueType

Definition at line 57 of file itkRingBuffer.h.

◆ Superclass

template<typename TElement >
using itk::RingBuffer< TElement >::Superclass = Object

Definition at line 49 of file itkRingBuffer.h.

Constructor & Destructor Documentation

◆ RingBuffer()

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

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

◆ ~RingBuffer()

template<typename TElement >
itk::RingBuffer< TElement >::~RingBuffer ( )
overrideprotecteddefault

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

Member Function Documentation

◆ BufferIsFull()

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

Report whether or not the indicated buffer is full

◆ CreateAnother()

template<typename TElement >
virtual::itk::LightObject::Pointer itk::RingBuffer< TElement >::CreateAnother ( ) 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.

◆ GetBufferContents()

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

Access the data from the indicated buffer

◆ GetHeadIndex()

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

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

Definition at line 93 of file itkRingBuffer.h.

◆ GetNameOfClass()

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

Run-time type information (and related methods).

Reimplemented from itk::Object.

◆ GetNumberOfBuffers()

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

Get the buffer size

◆ GetOffsetBufferIndex()

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

Get the proper buffer index from an offset

◆ MoveHead()

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

Move the Head pointer along the ring using the given offset

◆ MoveHeadBackward()

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

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

◆ MoveHeadForward()

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

Convenience methods for moving Head +/- 1

◆ New()

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

Method for creation through the object factory.

◆ PrintSelf()

template<typename TElement >
void itk::RingBuffer< TElement >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

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

Reimplemented from itk::Object.

◆ SetBufferContents()

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

Set the buffer contents of a buffer

◆ SetNumberOfBuffers()

template<typename TElement >
void itk::RingBuffer< TElement >::SetNumberOfBuffers ( SizeValueType  n)

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

◆ m_HeadIndex

template<typename TElement >
SizeValueType itk::RingBuffer< TElement >::m_HeadIndex { 0 }
protected

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

Definition at line 121 of file itkRingBuffer.h.

◆ m_PointerVector

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

Vector of pointers to elements

Definition at line 124 of file itkRingBuffer.h.


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