Turi Create
4.0
|
#include <model_server/lib/toolkit_class_registry.hpp>
Public Types | |
typedef std::map< std::string, flexible_type > | toolkit_class_description_type |
Public Member Functions | |
bool | register_toolkit_class (const std::string &class_name, std::function< model_base *()> constructor, toolkit_class_description_type description=toolkit_class_description_type()) |
bool | register_toolkit_class (std::vector< toolkit_class_specification > classes, std::string prefix="") |
std::shared_ptr< model_base > | get_toolkit_class (const std::string &class_name) |
std::map< std::string, flexible_type > | get_toolkit_class_description (const std::string &toolkit_class_name) |
std::vector< std::string > | available_toolkit_classes () |
Defines a collection of models. Has the ability to add/register new toolkits, and get information about the model.
Definition at line 17 of file toolkit_class_registry.hpp.
typedef std::map<std::string, flexible_type> turi::toolkit_class_registry::toolkit_class_description_type |
Register a model (name, constructor) pair.
Returns false if the model name already exists.
The optional "description" argument describing the model. The following keys are recognized.
Definition at line 31 of file toolkit_class_registry.hpp.
std::vector<std::string> turi::toolkit_class_registry::available_toolkit_classes | ( | ) |
Returns a list of names of all registered models.
std::shared_ptr<model_base> turi::toolkit_class_registry::get_toolkit_class | ( | const std::string & | class_name | ) |
Creates a new model object with the given model_name.
Throws an exception if the model_name was not registered.
std::map<std::string, flexible_type> turi::toolkit_class_registry::get_toolkit_class_description | ( | const std::string & | toolkit_class_name | ) |
Returns the description associated with the model.
Throws an exception if the model_name was not registered.
bool turi::toolkit_class_registry::register_toolkit_class | ( | const std::string & | class_name, |
std::function< model_base *()> | constructor, | ||
toolkit_class_description_type | description = toolkit_class_description_type() |
||
) |
Registers a toolkit class.
bool turi::toolkit_class_registry::register_toolkit_class | ( | std::vector< toolkit_class_specification > | classes, |
std::string | prefix = "" |
||
) |
Registers a toolkit class.