9 #ifndef audio_interface_factory_h 10 #define audio_interface_factory_h 27 namespace audiointerfaces
43 static std::vector<std::string> audioInterfacesList();
48 template<
class ConcreteAudioInterface >
49 static void registerAudioInterfaceType( std::string
const & interfaceName );
56 template<
class ConcreteAudioInterface >
60 explicit Registrar(std::string
const & interfaceName )
62 creatorTable().insert( std::make_pair( interfaceName, TCreator<ConcreteAudioInterface>() ) );
68 using CreateFunction = std::function< audiointerfaces::AudioInterface* ( audiointerfaces::AudioInterface::Configuration const & baseConfig, std::string const & config ) >;
69 explicit Creator( CreateFunction fcn );
73 CreateFunction mCreateFunction;
76 template<
class ConcreteAudioInterface >
77 class TCreator:
public Creator
81 : Creator( &TCreator<ConcreteAudioInterface>::construct )
92 using CreatorTable = std::map<std::string, Creator >;
94 static CreatorTable & creatorTable();
97 template<
class ConcreteAudioInterface >
100 creatorTable().insert( std::make_pair( interfaceName, TCreator<ConcreteAudioInterface>() ) );
Definition: audio_interface_factory.hpp:57
Definition: audio_interface.hpp:19
Definition: options.cpp:10
static void registerAudioInterfaceType(std::string const &interfaceName)
Definition: audio_interface_factory.hpp:98
Registrar(std::string const &interfaceName)
Definition: audio_interface_factory.hpp:60
Definition: audio_interface_factory.hpp:29
Definition: audio_interface.hpp:29