SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::simulation::TaskScheduler Class Referenceabstract

#include <TaskScheduler.h>

Inheritance diagram for sofa::simulation::TaskScheduler:

Static Protected Attributes

static std::map< std::string, std::function< TaskScheduler *()> > _schedulers
 
static std::string _currentSchedulerName
 
static TaskScheduler_currentScheduler = nullptr
 

Public Member Functions

virtual ~TaskScheduler ()
 
virtual void init (const unsigned int nbThread=0)=0
 
virtual void stop (void)=0
 
virtual unsigned int getThreadCount (void) const =0
 
virtual const char * getCurrentThreadName ()=0
 
virtual int getCurrentThreadType ()=0
 
virtual bool addTask (Task *task)=0
 
virtual void workUntilDone (Task::Status *status)=0
 
virtual Task::AllocatorgetTaskAllocator ()=0
 

Static Public Member Functions

static TaskSchedulercreate (const char *name="")
 
static bool registerScheduler (const char *name, std::function< TaskScheduler *()> creatorFunc)
 
static TaskSchedulergetInstance ()
 
static const std::string & getCurrentName ()
 

Friends

class Task
 

Attribute details

TaskScheduler * sofa::simulation::TaskScheduler::_currentScheduler = nullptr
staticprotected
std::string sofa::simulation::TaskScheduler::_currentSchedulerName
staticprotected
std::map< std::string, std::function< TaskScheduler *()> > sofa::simulation::TaskScheduler::_schedulers
staticprotected

Constructor details

sofa::simulation::TaskScheduler::~TaskScheduler ( )
virtual

Function details

virtual bool sofa::simulation::TaskScheduler::addTask ( Task task)
pure virtual
TaskScheduler * sofa::simulation::TaskScheduler::create ( const char *  name = "")
static
static const std::string& sofa::simulation::TaskScheduler::getCurrentName ( )
inlinestatic
virtual const char* sofa::simulation::TaskScheduler::getCurrentThreadName ( )
pure virtual
virtual int sofa::simulation::TaskScheduler::getCurrentThreadType ( )
pure virtual
TaskScheduler * sofa::simulation::TaskScheduler::getInstance ( )
static
virtual Task::Allocator* sofa::simulation::TaskScheduler::getTaskAllocator ( )
pure virtual
virtual unsigned int sofa::simulation::TaskScheduler::getThreadCount ( void  ) const
pure virtual
virtual void sofa::simulation::TaskScheduler::init ( const unsigned int  nbThread = 0)
pure virtual
bool sofa::simulation::TaskScheduler::registerScheduler ( const char *  name,
std::function< TaskScheduler *()>  creatorFunc 
)
static
virtual void sofa::simulation::TaskScheduler::stop ( void  )
pure virtual
virtual void sofa::simulation::TaskScheduler::workUntilDone ( Task::Status status)
pure virtual

Related details

friend class Task
friend