vsdk 10.1.0
 
Loading...
Searching...
No Matches
Vsdk::Asr::Engineabstract

Responsible for creation of Recognizer and DynamicModel instances. More...

#include <Engine.hpp>

Inheritance diagram for Vsdk::Asr::Engine:

Classes

struct  ModelInfo
 
struct  RecognizerInfo
 

Public Member Functions

 ~Engine () noexcept
 
auto recognizer (std::string const &name) -> std::shared_ptr< Recognizer >
 Gets or constructs a shared Recognizer instance that's been previously configured.
 
auto dynamicModel (std::string const &name) -> std::shared_ptr< DynamicModel >
 Gets or constructs a shared DynamicModel instance that's been previously configured.
 
auto recognizersInfo () const -> std::unordered_map< std::string, RecognizerInfo > const &
 
auto modelsInfo () const -> std::unordered_map< std::string, ModelInfo > const &
 

Static Public Member Functions

template<class T , typename... Args>
static auto make (Args &&... args) -> std::shared_ptr< Engine >
 Gets or constructs a shared Asr::Engine instance of type T with args.
 

Protected Member Functions

 Engine (char const *name, std::string const &configPath)
 
 Engine (char const *name, nlohmann::json config)
 
 Engine (char const *name, char const *configPath)
 Specialization used to avoid overload collisions, forwards to Engine(char const*, std::string const &);
 
virtual auto makeRecognizer (std::string name) -> Recognizer *=0
 
virtual auto makeDynamicModel (std::string name) -> DynamicModel *=0
 
void setRecognizerInfo (std::string const &name, RecognizerInfo info)
 
void setModelInfo (std::string const &name, ModelInfo info)
 

Detailed Description

Responsible for creation of Recognizer and DynamicModel instances.

Constructor & Destructor Documentation

◆ Engine() [1/3]

Engine::Engine ( char const * name,
std::string const & configPath )
protected
Parameters
nameName of the configuration object in vsdk.json
configPathPath to a vsdk.json formatted file

◆ Engine() [2/3]

Engine::Engine ( char const * name,
nlohmann::json config )
protected
Parameters
nameName of the configuration object in vsdk.json
configA vsdk.json formatted JSON configuration object

◆ Engine() [3/3]

Engine::Engine ( char const * name,
char const * configPath )
protected

Specialization used to avoid overload collisions, forwards to Engine(char const*, std::string const &);

Parameters
nameName of the configuration object in vsdk.json
configPathPath to a vsdk.json formatted file

◆ ~Engine()

Engine::~Engine ( )
noexcept

Member Function Documentation

◆ make()

template<class T , typename... Args>
static auto Vsdk::Asr::Engine::make ( Args &&... args) -> std::shared_ptr<Engine>
static

Gets or constructs a shared Asr::Engine instance of type T with args.

Note
If an engine of this type exists, a shared instance will be returned instead.

◆ recognizer()

auto Engine::recognizer ( std::string const & name) -> std::shared_ptr<Recognizer>

Gets or constructs a shared Recognizer instance that's been previously configured.

Parameters
nameFound in the configuration of this engine, name of the Recognizer you want

◆ dynamicModel()

auto Engine::dynamicModel ( std::string const & name) -> std::shared_ptr<DynamicModel>

Gets or constructs a shared DynamicModel instance that's been previously configured.

Parameters
nameFound in the configuration of this engine, name of the model you want

◆ recognizersInfo()

auto Engine::recognizersInfo ( ) const -> std::unordered_map<std::string, RecognizerInfo> const &

◆ modelsInfo()

auto Engine::modelsInfo ( ) const -> std::unordered_map<std::string, ModelInfo> const &

◆ makeRecognizer()

virtual auto Vsdk::Asr::Engine::makeRecognizer ( std::string name) -> Recognizer *
protectedpure virtual

◆ makeDynamicModel()

virtual auto Vsdk::Asr::Engine::makeDynamicModel ( std::string name) -> DynamicModel *
protectedpure virtual

◆ setRecognizerInfo()

void Engine::setRecognizerInfo ( std::string const & name,
Engine::RecognizerInfo info )
protected
Note
If info.name.empty() then removes entry

◆ setModelInfo()

void Engine::setModelInfo ( std::string const & name,
Engine::ModelInfo info )
protected
Note
If info.name.empty() then removes entry