NNModelInfoFactory
class NNModelInfoFactory
{
public:
static std::shared_ptr<NNModelInfoFactory> getInstance();
public:
std::vector<std::string> getModelNames();
std::shared_ptr<NNModelInfo> getModelInfo(std::string modelName);
public:
int addModelInfo(std::shared_ptr<NNModelInfo> modelInfo);
};
Introduction to the Class
A factory class responsible for managing and providing information about neural network models.
This class uses the Singleton design pattern to ensure that only one instance of it exists in the program. It maintains a collection of neural network model information and provides methods to retrieve and manipulate this information.
Introduction to the Class's Methods
static std::shared_ptr<NNModelInfoFactory> getInstance()
brief: Static method to gets the single instance of the NNModelInfoFactory class. Implements the Singleton design pattern to ensure global access to a single instance of the factory.
return shared_ptr<NNModelInfoFactory>: A shared pointer to the single instance of the factory.
std::vector<std::string> getModelNames()
brief: Retrieves the names of all registered neural network models.
return std::vector<std::string>: A vector containing the names of all registered models.
std::shared_ptr<NNModelInfo> getModelInfo(std::string modelName)
brief: Retrieves detailed information about a specific neural network model.
param
modelName: The name of the model to retrieve information for.
return shared_ptr<NNModelInfo>: A shared pointer to the model information, or nullptr if the model is not found.
int addModelInfo(std::shared_ptr<NNModelInfo> modelInfo)
brief: Adds new model information to the factory.
param
modelInfo: A shared pointer to the new model information to add.
return int: A status code indicating the success or failure of the addition.