IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::ModelManager Class Reference

Model manager. More...

#include </home/runner/work/iganet/iganet/webapps/modelmanager.hpp>

Inheritance diagram for iganet::ModelManager:
iganet::utils::FullQualifiedName

Public Member Functions

 ModelManager ()=delete
 Default constructor deleted.
 
void addModelPath (const std::string &path)
 Adds models from given path.
 
void addModelPath (const std::vector< std::string > &paths)
 Adds models from list of directories.
 
std::shared_ptr< Model< iganet::real_t > > create (const std::string &name, const nlohmann::json &json=NULL) const
 Returns a new instance of the requested model and throws an exception if model cannot be found.
 
nlohmann::json getModels () const
 Serializes the list of models to JSON.
 
std::shared_ptr< Model< iganet::real_t > > load (const nlohmann::json &json) const
 Returns a new model instance from binary data stream throws an exception if model cannot be created.
 
virtual void pretty_print (std::ostream &os=std::cout) const noexcept override
 Returns a string representation of the model manager object.
 

Private Attributes

std::map< std::string, std::shared_ptr< ModelHandler > > models
 List of models.
 

Additional Inherited Members

- Protected Member Functions inherited from iganet::utils::FullQualifiedName
virtual const std::string & name () const noexcept
 Returns the full qualified name of the object.
 
- Protected Attributes inherited from iganet::utils::FullQualifiedName
at::optional< std::string > name_
 String storing the full qualified name of the object.
 

Detailed Description

Model manager.

This class implements the model manager

Constructor & Destructor Documentation

◆ ModelManager() [1/3]

iganet::ModelManager::ModelManager ( )
delete

Default constructor deleted.

◆ ModelManager() [2/3]

iganet::ModelManager::ModelManager ( const std::string &  path)
inline

Constructor from filesystem.

◆ ModelManager() [3/3]

iganet::ModelManager::ModelManager ( const std::vector< std::string > &  paths)
inline

Constructor from filesystem.

Member Function Documentation

◆ addModelPath() [1/2]

void iganet::ModelManager::addModelPath ( const std::string &  path)
inline

Adds models from given path.

◆ addModelPath() [2/2]

void iganet::ModelManager::addModelPath ( const std::vector< std::string > &  paths)
inline

Adds models from list of directories.

◆ create()

std::shared_ptr< Model< iganet::real_t > > iganet::ModelManager::create ( const std::string &  name,
const nlohmann::json &  json = NULL 
) const
inline

Returns a new instance of the requested model and throws an exception if model cannot be found.

◆ getModels()

nlohmann::json iganet::ModelManager::getModels ( ) const
inline

Serializes the list of models to JSON.

◆ load()

std::shared_ptr< Model< iganet::real_t > > iganet::ModelManager::load ( const nlohmann::json &  json) const
inline

Returns a new model instance from binary data stream throws an exception if model cannot be created.

◆ pretty_print()

virtual void iganet::ModelManager::pretty_print ( std::ostream &  os = std::cout) const
inlineoverridevirtualnoexcept

Returns a string representation of the model manager object.

Implements iganet::utils::FullQualifiedName.

Member Data Documentation

◆ models

std::map<std::string, std::shared_ptr<ModelHandler> > iganet::ModelManager::models
private

List of models.


The documentation for this class was generated from the following file: