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

Responsible for creation of Authenticator and Identificator instances. More...

#include <Engine.hpp>

Inheritance diagram for Vsdk::Biometrics::Engine:

Public Member Functions

auto model (std::string const &name) -> std::shared_ptr< Model >
 Loads model name.
 
auto loadedModels () const -> std::unordered_map< std::string, std::shared_ptr< Model > > const &
 Gets the list of already loaded models.
 
virtual auto loadableModelNames () const -> std::vector< std::string >=0
 Gets the list of model names that can be loaded.
 
auto makeModel (std::string name, ModelType type) -> std::shared_ptr< Model >
 Creates a new, empty model of type type named name.
 
auto unloadModel (std::string const &name) -> size_t
 Releases the model from the engine.
 
auto unloadModel (std::shared_ptr< Model > &&model) -> size_t
 Releases the model from the engine.
 
void unloadModels ()
 Releases loaded models from the engine.
 
void deleteModel (std::string const &name)
 Unloads (if needed) and deletes the model from the filesystem.
 
auto makeAuthenticator (std::string name, std::shared_ptr< Model > model=nullptr, int threshold=5) -> std::shared_ptr< Authenticator >
 Creates a default constructed authenticator, initialized with model and threshold.
 
auto makeIdentificator (std::string name, std::shared_ptr< Model > model=nullptr, int threshold=5) -> std::shared_ptr< Identificator >
 Creates a default constructed identificator, initialized with model and threshold.
 

Static Public Member Functions

template<class T , typename... Args>
static auto make (Args &&... args) -> std::shared_ptr< Engine >
 Gets or constructs a shared Biometrics::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 bool modelExistsOnFilesystem (std::string const &name) const =0
 
virtual auto makeModelImpl (std::string name, ModelType type) -> Model *=0
 
virtual auto makeAuthenticatorImpl (std::string name) -> Authenticator *=0
 
virtual auto makeIdentificatorImpl (std::string name) -> Identificator *=0
 
virtual void deleteModelImpl (std::string const &name)=0
 

Detailed Description

Responsible for creation of Authenticator and Identificator 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

Member Function Documentation

◆ make()

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

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

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

◆ model()

auto Engine::model ( std::string const & name) -> std::shared_ptr<Model>

Loads model name.

◆ loadedModels()

auto Engine::loadedModels ( ) const -> std::unordered_map<std::string, std::shared_ptr<Model>> const &

Gets the list of already loaded models.

◆ loadableModelNames()

virtual auto Vsdk::Biometrics::Engine::loadableModelNames ( ) const -> std::vector< std::string >
pure virtual

Gets the list of model names that can be loaded.

Note
Does not contain the already loaded model names

◆ makeModel()

auto Engine::makeModel ( std::string name,
ModelType type ) -> std::shared_ptr<Model>

Creates a new, empty model of type type named name.

◆ unloadModel() [1/2]

auto Engine::unloadModel ( std::string const & name) -> size_t

Releases the model from the engine.

Note
The model will truly unload once the user releases all shared instances of it
Exceptions
Vsdk::Exceptionif the model cannot be found

◆ unloadModel() [2/2]

auto Engine::unloadModel ( std::shared_ptr< Model > && model) -> size_t

Releases the model from the engine.

Note
The model will truly unload once the user releases all shared instances of it
Exceptions
Vsdk::Exceptionif the model cannot be found

◆ unloadModels()

void Engine::unloadModels ( )

Releases loaded models from the engine.

Note
The models will truly unload once the user releases all shared instances for each of them

◆ deleteModel()

void Engine::deleteModel ( std::string const & name)

Unloads (if needed) and deletes the model from the filesystem.

Note
The model will truly unload and get deleted once the user releases all shared instances of it

◆ makeAuthenticator()

auto Engine::makeAuthenticator ( std::string name,
std::shared_ptr< Model > model = nullptr,
int threshold = 5 ) -> std::shared_ptr<Authenticator>

Creates a default constructed authenticator, initialized with model and threshold.

Parameters
thresholdMust be between [ 0 ; 10 ]

◆ makeIdentificator()

auto Engine::makeIdentificator ( std::string name,
std::shared_ptr< Model > model = nullptr,
int threshold = 5 ) -> std::shared_ptr<Identificator>

Creates a default constructed identificator, initialized with model and threshold.

Parameters
thresholdMust be between [ 0 ; 10 ]

◆ modelExistsOnFilesystem()

virtual bool Vsdk::Biometrics::Engine::modelExistsOnFilesystem ( std::string const & name) const
protectedpure virtual

◆ makeModelImpl()

virtual auto Vsdk::Biometrics::Engine::makeModelImpl ( std::string name,
ModelType type ) -> Model *
protectedpure virtual

◆ makeAuthenticatorImpl()

virtual auto Vsdk::Biometrics::Engine::makeAuthenticatorImpl ( std::string name) -> Authenticator *
protectedpure virtual

◆ makeIdentificatorImpl()

virtual auto Vsdk::Biometrics::Engine::makeIdentificatorImpl ( std::string name) -> Identificator *
protectedpure virtual

◆ deleteModelImpl()

virtual void Vsdk::Biometrics::Engine::deleteModelImpl ( std::string const & name)
protectedpure virtual