nfd::SizeCounter< T > Class Template Reference

provides a counter that observes the size of a table More...

#include <core/counter.hpp>

+ Inheritance diagram for nfd::SizeCounter< T >:

Public Types

typedef size_t Rep
 

Public Member Functions

constexpr SizeCounter (const T *table=nullptr)
 
 SizeCounter (const SizeCounter &)=delete
 
void observe (const T *table)
 
 operator Rep () const
 observe the counter More...
 
SizeCounteroperator= (const SizeCounter &)=delete
 

Detailed Description

template<typename T>
class nfd::SizeCounter< T >

provides a counter that observes the size of a table

Template Parameters
Ta type that provides a size() const member function

if table not specified in constructor, it can be added later by invoking observe()

Definition at line 114 of file counter.hpp.

Member Typedef Documentation

template<typename T>
typedef size_t nfd::SizeCounter< T >::Rep

Definition at line 117 of file counter.hpp.

Constructor & Destructor Documentation

template<typename T>
constexpr nfd::SizeCounter< T >::SizeCounter ( const T *  table = nullptr)
inlineexplicit

Definition at line 120 of file counter.hpp.

template<typename T>
nfd::SizeCounter< T >::SizeCounter ( const SizeCounter< T > &  )
delete

Member Function Documentation

template<typename T>
void nfd::SizeCounter< T >::observe ( const T *  table)
inline

Definition at line 131 of file counter.hpp.

template<typename T>
nfd::SizeCounter< T >::operator Rep ( ) const
inline

observe the counter

Definition at line 138 of file counter.hpp.

template<typename T>
SizeCounter& nfd::SizeCounter< T >::operator= ( const SizeCounter< T > &  )
delete