Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::TFifoClass< T > Class Template Reference

Fifo template for classes and structure pointers. More...

#include <TFifoClass.h>

Public Types

typedef int size_type
 

Public Member Functions

 TFifoClass ()
 Default constructor which needs Set() to validate object.
 
 TFifoClass (size_type size)
 Constructor that will setup the object immediately.
 
 ~TFifoClass ()
 Destructor.
 
bool push (const T &item)
 Pushes item into buffer.
 
bool push ()
 Push item of zero in fifo.
 
bool push (const T *item, size_type count)
 Pushes multiple items if possible else it returns '0' and no items are inserted at all.
 
const T & peek () const
 Returns next item without removing it.
 
const T & latest () const
 Gives latest item pushed into the fifo.
 
pop ()
 Read item at head of buffer and removes it.
 
bool pop (T &item)
 Same as pop(void) but returns 'false' when the buffer is empty.
 
bool empty () const
 Returns if current contained buffer data size is zero.
 
size_type size () const
 Returns current buffer contained data size.
 
size_type sizeMax () const
 Returns maximum containable size.
 
size_type sizeRemain () const
 Returns remaining available size.
 
bool isValid () const
 Returns 1 if object is valid else 0.
 
bool isFull () const
 Returns '1' if object is full else 0.
 
void clear ()
 Resets instance to the initial state.
 
bool set (size_type size)
 InitializeBase object after default construction or to increase size.
 
T & operator[] (size_type pos)
 Array operator offset from head of buffer.
 
const T & operator[] (size_type pos) const
 Const array operator offset from head of buffer.
 
size_type getTail () const
 Access function for private member.
 
size_type getHead () const
 Access function for private member.
 
const T * getBuffer (size_type pos=0) const
 Access function for private member.
 

Detailed Description

template<typename T>
class sf::TFifoClass< T >

Fifo template for classes and structure pointers.

Provides an array operator to iterate through the fifo. Allows peeking for the next without popping the item.

Member Typedef Documentation

◆ size_type

template<typename T >
typedef int sf::TFifoClass< T >::size_type

Type used for size and position.

Constructor & Destructor Documentation

◆ TFifoClass() [1/2]

template<typename T >
sf::TFifoClass< T >::TFifoClass ( )
inline

Default constructor which needs Set() to validate object.

◆ TFifoClass() [2/2]

template<typename T >
sf::TFifoClass< T >::TFifoClass ( size_type  size)
inlineexplicit

Constructor that will setup the object immediately.

◆ ~TFifoClass()

template<typename T >
sf::TFifoClass< T >::~TFifoClass ( )

Destructor.

Member Function Documentation

◆ clear()

template<typename T >
void sf::TFifoClass< T >::clear ( )
inline

Resets instance to the initial state.

◆ empty()

template<typename T >
bool sf::TFifoClass< T >::empty ( ) const

Returns if current contained buffer data size is zero.

◆ getBuffer()

template<typename T >
const T * sf::TFifoClass< T >::getBuffer ( size_type  pos = 0) const

Access function for private member.

◆ getHead()

template<typename T >
size_type sf::TFifoClass< T >::getHead ( ) const

Access function for private member.

◆ getTail()

template<typename T >
size_type sf::TFifoClass< T >::getTail ( ) const

Access function for private member.

◆ isFull()

template<typename T >
bool sf::TFifoClass< T >::isFull ( ) const
inline

Returns '1' if object is full else 0.

◆ isValid()

template<typename T >
bool sf::TFifoClass< T >::isValid ( ) const
inline

Returns 1 if object is valid else 0.

◆ latest()

template<typename T >
const T & sf::TFifoClass< T >::latest ( ) const

Gives latest item pushed into the fifo.

◆ operator[]() [1/2]

template<typename T >
T & sf::TFifoClass< T >::operator[] ( size_type  pos)

Array operator offset from head of buffer.

◆ operator[]() [2/2]

template<typename T >
const T & sf::TFifoClass< T >::operator[] ( size_type  pos) const

Const array operator offset from head of buffer.

◆ peek()

template<typename T >
const T & sf::TFifoClass< T >::peek ( ) const

Returns next item without removing it.

◆ pop() [1/2]

template<typename T >
T sf::TFifoClass< T >::pop ( )

Read item at head of buffer and removes it.

◆ pop() [2/2]

template<typename T >
bool sf::TFifoClass< T >::pop ( T &  item)

Same as pop(void) but returns 'false' when the buffer is empty.

◆ push() [1/3]

template<typename T >
bool sf::TFifoClass< T >::push ( )

Push item of zero in fifo.

◆ push() [2/3]

template<typename T >
bool sf::TFifoClass< T >::push ( const T &  item)

Pushes item into buffer.

Parameters
itemItem pushed.
Returns
True when successful (not full).

◆ push() [3/3]

template<typename T >
bool sf::TFifoClass< T >::push ( const T *  item,
size_type  count 
)

Pushes multiple items if possible else it returns '0' and no items are inserted at all.

◆ set()

template<typename T >
bool sf::TFifoClass< T >::set ( size_type  size)

InitializeBase object after default construction or to increase size.

Returns
1 if valid else 0.

◆ size()

template<typename T >
size_type sf::TFifoClass< T >::size ( ) const

Returns current buffer contained data size.

◆ sizeMax()

template<typename T >
size_type sf::TFifoClass< T >::sizeMax ( ) const
inline

Returns maximum containable size.

◆ sizeRemain()

template<typename T >
size_type sf::TFifoClass< T >::sizeRemain ( ) const
inline

Returns remaining available size.


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