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

Used by Authenticator and Identificator instances, containing a bunch of audio records associated with user names. More...

#include <Model.hpp>

Inheritance diagram for Vsdk::Biometrics::Model:

Public Member Functions

virtual ~Model () noexcept
 
auto type () const -> ModelType
 
auto name () const -> std::string const &
 
auto users () const -> std::vector< std::string > const &
 Gets the list of users registered in this model.
 
auto path () const -> std::string const &
 Gets the path of the model file.
 
auto analyseRecord (std::string const &path) -> std::pair< bool, nlohmann::json >
 Analyses a user record from a file.
 
auto analyseRecord (Vsdk::Audio::Buffer const &buffer) -> std::pair< bool, nlohmann::json >
 Analyses a user record from an audio buffer.
 
void addRecord (std::string const &user, std::string const &path)
 Adds a user record from a file.
 
void addRecord (std::string const &user, Audio::Buffer buffer)
 Adds a user record from an audio buffer.
 
void eraseUser (std::string const &name)
 Erases an user and all its audio records.
 
void compile ()
 Finalizes the model before being used.
 

Protected Member Functions

 Model (std::shared_ptr< Engine > engine, std::string name, ModelType type)
 
virtual auto usersImpl () const -> std::vector< std::string > const &=0
 
virtual auto pathImpl () const -> std::string const &=0
 
virtual auto analyseRecordImpl (std::string const &path) -> std::pair< bool, nlohmann::json >=0
 
virtual auto analyseRecordImpl (Vsdk::Audio::Buffer const &buffer) -> std::pair< bool, nlohmann::json >=0
 
virtual void addRecordImpl (std::string const &user, std::string const &path)=0
 
virtual void addRecordImpl (std::string const &user, Audio::Buffer buffer)=0
 
virtual void eraseUserImpl (std::string const &name)=0
 
virtual void compileImpl ()=0
 
void setModelType (ModelType type)
 
void throwIfDeleted () const
 

Detailed Description

Used by Authenticator and Identificator instances, containing a bunch of audio records associated with user names.

Constructor & Destructor Documentation

◆ Model()

Model::Model ( std::shared_ptr< Engine > engine,
std::string name,
ModelType type )
protected

◆ ~Model()

Model::~Model ( )
virtualnoexcept

Member Function Documentation

◆ type()

auto Model::type ( ) const -> ModelType

◆ name()

auto Model::name ( ) const -> std::string const &

◆ users()

auto Vsdk::Biometrics::Model::users ( ) const -> std::vector<std::string> const &

Gets the list of users registered in this model.

◆ path()

auto Vsdk::Biometrics::Model::path ( ) const -> std::string const &

Gets the path of the model file.

◆ analyseRecord() [1/2]

auto Vsdk::Biometrics::Model::analyseRecord ( std::string const & path) -> std::pair<bool, nlohmann::json>

Analyses a user record from a file.

Returns
a pair comprising a boolean value 'accepted' indicating whether the record has the default requirements or not, and a JSON object containing detailed information about the record

◆ analyseRecord() [2/2]

auto Vsdk::Biometrics::Model::analyseRecord ( Vsdk::Audio::Buffer const & buffer) -> std::pair<bool, nlohmann::json>

Analyses a user record from an audio buffer.

Returns
a pair comprising a boolean value 'accepted' indicating whether the record has the default requirements or not, and a JSON object containing detailed information about the record

◆ addRecord() [1/2]

void Vsdk::Biometrics::Model::addRecord ( std::string const & user,
std::string const & path )

Adds a user record from a file.

◆ addRecord() [2/2]

void Vsdk::Biometrics::Model::addRecord ( std::string const & user,
Audio::Buffer buffer )

Adds a user record from an audio buffer.

◆ eraseUser()

void Vsdk::Biometrics::Model::eraseUser ( std::string const & name)

Erases an user and all its audio records.

◆ compile()

void Vsdk::Biometrics::Model::compile ( )

Finalizes the model before being used.

◆ usersImpl()

virtual auto Vsdk::Biometrics::Model::usersImpl ( ) const -> std::vector< std::string > const &
protectedpure virtual

◆ pathImpl()

virtual auto Vsdk::Biometrics::Model::pathImpl ( ) const -> std::string const &
protectedpure virtual

◆ analyseRecordImpl() [1/2]

virtual auto Vsdk::Biometrics::Model::analyseRecordImpl ( std::string const & path) -> std::pair< bool, nlohmann::json >
protectedpure virtual

◆ analyseRecordImpl() [2/2]

virtual auto Vsdk::Biometrics::Model::analyseRecordImpl ( Vsdk::Audio::Buffer const & buffer) -> std::pair< bool, nlohmann::json >
protectedpure virtual

◆ addRecordImpl() [1/2]

virtual void Vsdk::Biometrics::Model::addRecordImpl ( std::string const & user,
std::string const & path )
protectedpure virtual

◆ addRecordImpl() [2/2]

virtual void Vsdk::Biometrics::Model::addRecordImpl ( std::string const & user,
Audio::Buffer buffer )
protectedpure virtual

◆ eraseUserImpl()

virtual void Vsdk::Biometrics::Model::eraseUserImpl ( std::string const & name)
protectedpure virtual

◆ compileImpl()

virtual void Vsdk::Biometrics::Model::compileImpl ( )
protectedpure virtual

◆ setModelType()

void Model::setModelType ( ModelType type)
protected

◆ throwIfDeleted()

void Vsdk::Biometrics::Model::throwIfDeleted ( ) const
protected