Documentation for OpenFLUID 2.2.0
openfluid::machine::SimulatorRegistry Class Reference

#include <machine/SimulatorRegistry.hpp>

Public Member Functions

bool addWare (const openfluid::ware::WareID_t &ID)
 
void discoverWares (const std::string IDPattern="")
 
void discoverWares (bool WithGhosts, const std::string IDPattern="")
 
openfluid::ware::WareID_t addGenerator (const GeneratorSpecs &Specs)
 
const WareContainer< openfluid::ware::SimulatorSignature > & generatorContainer (const openfluid::ware::WareID_t &ID) const
 
const WareContainer< openfluid::ware::SimulatorSignature > & wareOrGeneratorContainer (const openfluid::ware::WareID_t &ID) const
 
bool hasGenerator (const openfluid::ware::WareID_t &ID) const
 
const WaresByID_tgenerators () const
 
void clearGenerators ()
 
void clear ()
 
- Public Member Functions inherited from openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >
void clearWares ()
 
const WareContainer< openfluid::ware::SimulatorSignature > & wareContainer (const openfluid::ware::WareID_t &ID) const
 
const WaresByID_tavailableWares () const
 
const WaresByPath_terroredWares () const
 
bool hasAvailableWare (const openfluid::ware::WareID_t &ID) const
 

Additional Inherited Members

- Public Types inherited from openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >
using WaresByID_t = std::map< openfluid::ware::WareID_t, WareContainer< openfluid::ware::SimulatorSignature > >
 
using WaresByPath_t = std::map< std::string, WareContainer< openfluid::ware::SimulatorSignature > >
 
- Protected Member Functions inherited from openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >
virtual ~WareRegistry ()
 
bool add (WareContainer< openfluid::ware::SimulatorSignature > Container)
 
- Protected Attributes inherited from openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >
WaresByID_t m_AvailableWares
 
WaresByPath_t m_ErroredWares
 
WareContainer< openfluid::ware::SimulatorSignaturem_InvalidWareContainer
 
Inheritance diagram for openfluid::machine::SimulatorRegistry:
Collaboration diagram for openfluid::machine::SimulatorRegistry:

Member Function Documentation

◆ addGenerator()

openfluid::ware::WareID_t openfluid::machine::SimulatorRegistry::addGenerator ( const GeneratorSpecs Specs)

Creates a generator and adds it in the registry if everything went fine

Parameters
[in]Specsthe specifications of the generator to create
Returns
the ID of the generator if successfully added, an empty string otherwise

◆ addWare()

bool openfluid::machine::SimulatorRegistry::addWare ( const openfluid::ware::WareID_t ID)
virtual

Loads a simulator ware and adds it in the registry if everything went fine

Parameters
[in]IDthe ID of the ware to load
Returns
true if the wares is successfully added

Implements openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >.

◆ clear()

void openfluid::machine::SimulatorRegistry::clear ( )
inlinevirtual

Clears the registry (simulators and generators)

Implements openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >.

◆ clearGenerators()

void openfluid::machine::SimulatorRegistry::clearGenerators ( )
inline

Clears the generators stored in the registry

◆ discoverWares() [1/2]

void openfluid::machine::SimulatorRegistry::discoverWares ( bool  WithGhosts,
const std::string  IDPattern = "" 
)

Automatically discovers simulators wares (plugins and optionnaly ghosts) and adds it in the registry, optionally filtered on IDs using a given pattern

Parameters
[in]WithGhostsenable/disable the search for ghosts simulators
[in]IDPatternthe pattern to filter the wares on ID. Default is empty (no filtering)

◆ discoverWares() [2/2]

void openfluid::machine::SimulatorRegistry::discoverWares ( const std::string  IDPattern = "")
virtual

Automatically discovers simulators wares (plugins and ghosts) and adds it in the registry, optionally filtered on IDs using a given pattern

Parameters
[in]IDPatternthe pattern to filter the wares on ID. Default is empty (no filtering)

Implements openfluid::machine::WareRegistry< openfluid::ware::SimulatorSignature >.

◆ generatorContainer()

const WareContainer<openfluid::ware::SimulatorSignature>& openfluid::machine::SimulatorRegistry::generatorContainer ( const openfluid::ware::WareID_t ID) const

Returns the container of the generator given by its ID

Parameters
[in]IDThe ID of the ware
Returns
The container of the requested generator, an invalid container if not found

◆ generators()

const WaresByID_t& openfluid::machine::SimulatorRegistry::generators ( ) const
inline

Returns the created generators, indexed by ID

Returns
an ID-container map of generators

◆ hasGenerator()

bool openfluid::machine::SimulatorRegistry::hasGenerator ( const openfluid::ware::WareID_t ID) const
inline

Returns true if a generator already exists with the given ID

Parameters
[in]IDThe ID of the generator
Returns
true if the generator exists

◆ wareOrGeneratorContainer()

const WareContainer<openfluid::ware::SimulatorSignature>& openfluid::machine::SimulatorRegistry::wareOrGeneratorContainer ( const openfluid::ware::WareID_t ID) const

Returns the container of the simulator ware or the generator given by its ID. It searches first in the available simulators then in the created generators.

Parameters
[in]IDThe ID of the simulator or generator
Returns
The container of the requested ware, an invalid container if not found

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