salsa
0.7.1
|
Base salsa TaskState class. More...
#include <TaskState.hh>
Public Types | |
enum | EState { idle , assigned , running , killed , all } |
Status of task. | |
Public Member Functions | |
TaskState (TaskExecutor *te=nullptr) | |
virtual | ~TaskState () |
void | id (uint32_t id) |
uint32_t | id () const |
void | state (EState s) |
EState | state () const |
TaskInfo * | task () const |
void | task (TaskInfo *t) |
void | print (bool verbose=false) const |
void | pid (uint32_t pid) |
uint32_t | pid () const |
void | killTask () |
TaskExecutor * | executor () |
Static Public Member Functions | |
static std::shared_ptr< spdlog::logger > | getConsoleOutput () |
Get console output. | |
static void | setConsoleLevel (spdlog::level::level_enum level) |
Sets console log level. | |
Protected Attributes | |
uint32_t | mId = 0 |
ID of task state. | |
EState | mState = idle |
Status of actor. | |
TaskInfo * | mpTask = nullptr |
TaskInfo held by said actor. | |
uint32_t | mPID = 0 |
Task PID. | |
TaskExecutor * | mpTaskExecutor = nullptr |
Task Executor. | |
Static Private Attributes | |
static std::shared_ptr< spdlog::logger > | mspConsoleLogger = spdlog::stdout_color_mt("salsa") |
Pointer to spd logger. | |
Base salsa TaskState class.
Definition at line 16 of file TaskState.hh.
Salsa::TaskState::TaskState | ( | TaskExecutor * | te = nullptr | ) |
Constructor
Definition at line 6 of file TaskState.cc.
|
virtual |
TaskExecutor * Salsa::TaskState::executor | ( | ) |
Returns task executor
Definition at line 83 of file TaskState.cc.
References mpTaskExecutor.
Referenced by Salsa::NodeManagerZyre::addTaskSlot(), Salsa::TaskPool::handlePipe(), and Salsa::NodeManagerZyre::runTask().
uint32_t Salsa::TaskState::id | ( | ) | const |
void Salsa::TaskState::id | ( | uint32_t | id | ) |
Seting id
Definition at line 21 of file TaskState.cc.
Referenced by Salsa::TaskPool::add(), Salsa::TaskPool::handlePipe(), and Salsa::Worker::onWhisper().
void Salsa::TaskState::killTask | ( | ) |
uint32_t Salsa::TaskState::pid | ( | ) | const |
void Salsa::TaskState::pid | ( | uint32_t | pid | ) |
Seting PID
Definition at line 51 of file TaskState.cc.
Referenced by Salsa::TaskExecutorForkZmq::handlePipe(), and Salsa::TaskPool::handlePipe().
void Salsa::TaskState::print | ( | bool | verbose = false | ) | const |
Prints task pool info
Definition at line 111 of file TaskState.cc.
TaskState::EState Salsa::TaskState::state | ( | ) | const |
void Salsa::TaskState::state | ( | EState | s | ) |
Seting state
Definition at line 36 of file TaskState.cc.
References mState.
Referenced by Salsa::TaskExecutorForkZmq::handlePipe(), Salsa::TaskPool::handlePipe(), Salsa::Worker::onWhisper(), and Salsa::TaskExecutorFake::run().
TaskInfo * Salsa::TaskState::task | ( | ) | const |
Returns task
Definition at line 66 of file TaskState.cc.
References mpTask.
Referenced by Salsa::TaskExecutorForkZmq::handlePipe(), Salsa::TaskPool::handlePipe(), Salsa::Worker::onWhisper(), Salsa::TaskExecutorForkZmq::run(), and Salsa::NodeManagerZyre::runTask().
void Salsa::TaskState::task | ( | TaskInfo * | t | ) |