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

#include <TaskSchedulerRegistry.h>

Detailed Description

Container for task schedulers and its associated name The registry is also owner of the schedulers: it destroys them in its destructor

Protected Attributes

std::map< std::string, TaskScheduler * > m_schedulers
 
std::optional< std::pair< std::string, TaskScheduler * > > m_lastInserted {}
 

Public Member Functions

bool addTaskSchedulerToRegistry (TaskScheduler *taskScheduler, const std::string &taskSchedulerName)
 
TaskSchedulergetTaskScheduler (const std::string &taskSchedulerName) const
 
bool hasScheduler (const std::string &taskSchedulerName) const
 
const std::optional< std::pair< std::string, TaskScheduler * > > & getLastInserted () const
 
void clear ()
 
 ~TaskSchedulerRegistry ()
 

Attribute details

◆ m_lastInserted

std::optional<std::pair<std::string, TaskScheduler*> > sofa::simulation::TaskSchedulerRegistry::m_lastInserted {}
protected

◆ m_schedulers

std::map<std::string, TaskScheduler*> sofa::simulation::TaskSchedulerRegistry::m_schedulers
protected

Constructor details

◆ ~TaskSchedulerRegistry()

sofa::simulation::TaskSchedulerRegistry::~TaskSchedulerRegistry ( )

Function details

◆ addTaskSchedulerToRegistry()

bool sofa::simulation::TaskSchedulerRegistry::addTaskSchedulerToRegistry ( TaskScheduler taskScheduler,
const std::string &  taskSchedulerName 
)

Add a task scheduler to the registry and transfer the ownership

◆ clear()

void sofa::simulation::TaskSchedulerRegistry::clear ( )

Clear the registry and destroy the task schedulers sstored in the registry

◆ getLastInserted()

const std::optional< std::pair< std::string, TaskScheduler * > > & sofa::simulation::TaskSchedulerRegistry::getLastInserted ( ) const

◆ getTaskScheduler()

TaskScheduler * sofa::simulation::TaskSchedulerRegistry::getTaskScheduler ( const std::string &  taskSchedulerName) const
Returns
a @TaskScheduler if the scheduler name is found in the registry, nullptr otherwise

◆ hasScheduler()

bool sofa::simulation::TaskSchedulerRegistry::hasScheduler ( const std::string &  taskSchedulerName) const
Returns
true if the scheduler name is found in the registry, false otherwise