hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::containers::RingBuffer< T, Count > Class Template Referencefinal

#include "ring_buffer.hpp"

Collaboration diagram for iroha::containers::RingBuffer< T, Count >:
Collaboration graph

Public Types

using Type = T
 
using Handle = size_t
 

Public Member Functions

 RingBuffer ()
 
 ~RingBuffer ()
 
template<typename FuncOnAdd , typename FuncOnRemove , typename... Args>
void push (FuncOnAdd &&on_add, FuncOnRemove &&on_remove, Args &&... args)
 
template<typename FuncOnRemove >
void pop (FuncOnRemove &&on_remove)
 
TypegetItem (Handle h)
 
Type const & getItem (Handle h) const
 
bool empty () const
 
size_t size () const
 

Detailed Description

template<typename T, size_t Count>
class iroha::containers::RingBuffer< T, Count >

Ring buffer implementation with static array layout. Can be used on stack.

Template Parameters
T- type of element of the buffer
Count- number of the elements in the buffer

Member Typedef Documentation

◆ Handle

template<typename T, size_t Count>
using iroha::containers::RingBuffer< T, Count >::Handle = size_t

◆ Type

template<typename T, size_t Count>
using iroha::containers::RingBuffer< T, Count >::Type = T

Constructor & Destructor Documentation

◆ RingBuffer()

template<typename T, size_t Count>
iroha::containers::RingBuffer< T, Count >::RingBuffer ( )
inline

◆ ~RingBuffer()

template<typename T, size_t Count>
iroha::containers::RingBuffer< T, Count >::~RingBuffer ( )
inline

Member Function Documentation

◆ empty()

template<typename T, size_t Count>
bool iroha::containers::RingBuffer< T, Count >::empty ( ) const
inline

◆ getItem() [1/2]

template<typename T, size_t Count>
Type& iroha::containers::RingBuffer< T, Count >::getItem ( Handle  h)
inline

◆ getItem() [2/2]

template<typename T, size_t Count>
Type const& iroha::containers::RingBuffer< T, Count >::getItem ( Handle  h) const
inline

◆ pop()

template<typename T, size_t Count>
template<typename FuncOnRemove >
void iroha::containers::RingBuffer< T, Count >::pop ( FuncOnRemove &&  on_remove)
inline
Here is the caller graph for this function:

◆ push()

template<typename T, size_t Count>
template<typename FuncOnAdd , typename FuncOnRemove , typename... Args>
void iroha::containers::RingBuffer< T, Count >::push ( FuncOnAdd &&  on_add,
FuncOnRemove &&  on_remove,
Args &&...  args 
)
inline

◆ size()

template<typename T, size_t Count>
size_t iroha::containers::RingBuffer< T, Count >::size ( ) const
inline

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