SOFA API  1c8b807d
Open source framework for multi-physics simuation
sofa::simulation::WorkerThread Class Reference

#include <WorkerThread.h>

Public Member Functions

 WorkerThread (DefaultTaskScheduler *const &taskScheduler, int index, const std::string &name="Worker")
 
 ~WorkerThread ()
 
bool addTask (Task *pTask)
 
void workUntilDone (Task::Status *status)
 
const Task::StatusgetCurrentStatus () const
 
const chargetName () const
 
int getType () const
 
const std::thread::id getId () const
 
const std::deque< Task * > * getTasksQueue ()
 
std::uint64_t getTaskCount ()
 

Friends

class DefaultTaskScheduler
 

Constructor details

◆ WorkerThread()

sofa::simulation::WorkerThread::WorkerThread ( DefaultTaskScheduler *const &  taskScheduler,
int  index,
const std::string &  name = "Worker" 
)

◆ ~WorkerThread()

sofa::simulation::WorkerThread::~WorkerThread ( )

Function details

◆ addTask()

bool sofa::simulation::WorkerThread::addTask ( Task pTask)

◆ getCurrentStatus()

const Task::Status* sofa::simulation::WorkerThread::getCurrentStatus ( ) const
inline

◆ getId()

const std::thread::id sofa::simulation::WorkerThread::getId ( ) const

◆ getName()

const char* sofa::simulation::WorkerThread::getName ( ) const
inline

◆ getTaskCount()

std::uint64_t sofa::simulation::WorkerThread::getTaskCount ( )
inline

◆ getTasksQueue()

const std::deque<Task*>* sofa::simulation::WorkerThread::getTasksQueue ( )
inline

◆ getType()

int sofa::simulation::WorkerThread::getType ( ) const
inline

◆ workUntilDone()

void sofa::simulation::WorkerThread::workUntilDone ( Task::Status status)

Related details

◆ DefaultTaskScheduler

friend class DefaultTaskScheduler
friend