cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::metrics::MetricFactory< T > Class Template Reference

#include <metric_factory.hpp>

Public Types

using metric_ptr = std::unique_ptr< IMetric< T > >
 
using creator_func = std::function< metric_ptr()>
 

Public Member Functions

template<typename MetricType >
void register_metric (const std::string &name)
 
void register_metric (const std::string &name, creator_func creator)
 
metric_ptr create (const std::string &name) const
 
std::vector< std::string > available_metrics () const
 
void clear ()
 

Static Public Member Functions

static MetricFactoryinstance ()
 

Member Typedef Documentation

◆ creator_func

template<typename T >
using toolbox::metrics::MetricFactory< T >::creator_func = std::function<metric_ptr()>

◆ metric_ptr

template<typename T >
using toolbox::metrics::MetricFactory< T >::metric_ptr = std::unique_ptr<IMetric<T> >

Member Function Documentation

◆ available_metrics()

template<typename T >
std::vector< std::string > toolbox::metrics::MetricFactory< T >::available_metrics ( ) const
inline

◆ clear()

template<typename T >
void toolbox::metrics::MetricFactory< T >::clear ( )
inline

◆ create()

template<typename T >
metric_ptr toolbox::metrics::MetricFactory< T >::create ( const std::string &  name) const
inline

◆ instance()

template<typename T >
static MetricFactory & toolbox::metrics::MetricFactory< T >::instance ( )
inlinestatic

◆ register_metric() [1/2]

template<typename T >
template<typename MetricType >
void toolbox::metrics::MetricFactory< T >::register_metric ( const std::string &  name)
inline

◆ register_metric() [2/2]

template<typename T >
void toolbox::metrics::MetricFactory< T >::register_metric ( const std::string &  name,
creator_func  creator 
)
inline

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