SOFA API  ca665544
Open source framework for multi-physics simuation
sofa::simulation::TaskSchedulerFactory Class Reference

#include <TaskSchedulerFactory.h>

Detailed Description

Simple factory structure used to instantiate a @TaskScheduler based on a name. The name and a creation function must be registered before trying to instantiate.

Public Member Functions

bool registerScheduler (const std::string &name, const std::function< TaskScheduler *()> &creatorFunc)
 
TaskSchedulerinstantiate (const std::string &name)
 
std::set< std::string > getAvailableSchedulers ()
 

Function details

◆ getAvailableSchedulers()

std::set< std::string > sofa::simulation::TaskSchedulerFactory::getAvailableSchedulers ( )
Returns
a list of registered schedulers

◆ instantiate()

TaskScheduler * sofa::simulation::TaskSchedulerFactory::instantiate ( const std::string &  name)

◆ registerScheduler()

bool sofa::simulation::TaskSchedulerFactory::registerScheduler ( const std::string &  name,
const std::function< TaskScheduler *()> &  creatorFunc 
)

Register a new scheduler in the factory

Parameters
namekey in the factory
creatorFuncfunction creating a new TaskScheduler or a derived class
Returns
false if scheduler could not be registered