3 #ifndef VISR_LIBRBBL_FRACTIONAL_DELAY_FACTORY_HPP_INCLUDED 4 #define VISR_LIBRBBL_FRACTIONAL_DELAY_FACTORY_HPP_INCLUDED 19 template<
typename SampleType >
20 class FractionalDelayBase;
26 template <
typename SampleType>
30 static std::unique_ptr<FractionalDelayBase<SampleType> > create( std::string
const & name,
31 std::size_t maxNumSamples );
33 template<
class InterpolatorType >
34 static void registerAlgorithm( std::string
const & name );
39 using CreateFunction = std::function< std::unique_ptr<FractionalDelayBase<SampleType> >(std::size_t) >;
41 explicit Creator( CreateFunction fcn );
43 std::unique_ptr<FractionalDelayBase<SampleType> > create( std::size_t maxNumSamples )
const;
45 CreateFunction mCreateFunction;
48 template<
class InterpolatorType >
49 class TCreator:
public Creator
53 : Creator( &TCreator<InterpolatorType>::construct )
57 static std::unique_ptr<FractionalDelayBase<SampleType> > construct( std::size_t maxNumSamples )
59 return std::unique_ptr<FractionalDelayBase<SampleType> >(
new InterpolatorType( maxNumSamples ) );
63 using CreatorTable = std::map<std::string const, Creator >;
65 static CreatorTable & creatorTable();
68 template<
class SampleType >
69 template<
class InterpolatorType >
72 creatorTable().insert( std::make_pair( name, TCreator<InterpolatorType>() ) );
78 #endif // #ifndef VISR_LIBRBBL_FRACTIONAL_DELAY_FACTORY_HPP_INCLUDED Definition: options.cpp:10
static void registerAlgorithm(std::string const &name)
Definition: fractional_delay_factory.hpp:70
Definition: fractional_delay_factory.hpp:27