salsa 0.7.1
Loading...
Searching...
No Matches
Salsa::TaskPool Class Reference

Base salsa TaskPool class. More...

#include <TaskPool.hh>

Inheritance diagram for Salsa::TaskPool:
Salsa::Object

Public Member Functions

 TaskPool (NodeManager *pNM)
 
virtual ~TaskPool ()
 
void add (void *p, TaskState *t)
 
TaskStatefind (void *p) const
 
TaskStatefindById (uint32_t id) const
 
TaskStatefindFreeTask () const
 
void changeState (uint32_t id, TaskState::EState state)
 
uint32_t nSlotFree ()
 
bool terminateJob (Job *pJob)
 
bool handlePipe (void *pPipe)
 
void print (bool verbose=false) const
 

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

std::map< void *, TaskState * > mTasks {}
 List of task slots.
 
NodeManagermpNodeManager = nullptr
 Node manager.
 

Static Private Attributes

static std::shared_ptr< spdlog::logger > mspConsoleLogger = spdlog::stdout_color_mt("salsa")
 Pointer to spd logger.
 

Detailed Description

Constructor & Destructor Documentation

◆ TaskPool()

Salsa::TaskPool::TaskPool ( NodeManager * pNM)

Constructor

Definition at line 7 of file TaskPool.cc.

References mpNodeManager, and Salsa::Object::Object().

◆ ~TaskPool()

Salsa::TaskPool::~TaskPool ( )
virtual

Destructor

Definition at line 13 of file TaskPool.cc.

References mTasks.

Member Function Documentation

◆ add()

void Salsa::TaskPool::add ( void * p,
TaskState * t )

Adds Task EState

Definition at line 24 of file TaskPool.cc.

References Salsa::TaskState::id(), and mTasks.

◆ changeState()

void Salsa::TaskPool::changeState ( uint32_t id,
TaskState::EState state )

Change state for task with id

Definition at line 87 of file TaskPool.cc.

References mTasks.

◆ find()

TaskState * Salsa::TaskPool::find ( void * p) const

Returns TaskState /param p pointer

Definition at line 35 of file TaskPool.cc.

References mTasks.

Referenced by handlePipe().

◆ findById()

TaskState * Salsa::TaskPool::findById ( uint32_t id) const

Returns task state by id

Definition at line 48 of file TaskPool.cc.

References mTasks.

◆ findFreeTask()

TaskState * Salsa::TaskPool::findFreeTask ( ) const

Find avail slot in task pool

Definition at line 61 of file TaskPool.cc.

References mTasks.

Referenced by handlePipe().

◆ getConsoleOutput()

static std::shared_ptr< spdlog::logger > Salsa::Object::getConsoleOutput ( )
inlinestaticinherited

Get console output.

Definition at line 21 of file Object.hh.

References mspConsoleLogger.

Referenced by Salsa::ConfigZyre::apply().

◆ handlePipe()

◆ nSlotFree()

uint32_t Salsa::TaskPool::nSlotFree ( )

Return n free slots

Definition at line 74 of file TaskPool.cc.

References mTasks.

◆ print()

void Salsa::TaskPool::print ( bool verbose = false) const

Prints task pool info

Definition at line 128 of file TaskPool.cc.

References mTasks.

Referenced by handlePipe().

◆ setConsoleLevel()

static void Salsa::Object::setConsoleLevel ( spdlog::level::level_enum level)
inlinestaticinherited

Sets console log level.

Definition at line 29 of file Object.hh.

References mspConsoleLogger.

◆ terminateJob()

bool Salsa::TaskPool::terminateJob ( Job * pJob)

Kill all tasks from pJob

Definition at line 99 of file TaskPool.cc.

References mTasks, Salsa::Job::print(), and Salsa::Job::tasks().

Member Data Documentation

◆ mpNodeManager

NodeManager* Salsa::TaskPool::mpNodeManager = nullptr
protected

Node manager.

Definition at line 38 of file TaskPool.hh.

Referenced by handlePipe(), and TaskPool().

◆ mspConsoleLogger

std::shared_ptr< spdlog::logger > Salsa::Object::mspConsoleLogger = spdlog::stdout_color_mt("salsa")
staticprivateinherited

Pointer to spd logger.

Definition at line 32 of file Object.hh.

Referenced by getConsoleOutput(), and setConsoleLevel().

◆ mTasks

std::map<void *, TaskState *> Salsa::TaskPool::mTasks {}
protected

List of task slots.

Definition at line 37 of file TaskPool.hh.

Referenced by add(), changeState(), find(), findById(), findFreeTask(), nSlotFree(), print(), terminateJob(), and ~TaskPool().


The documentation for this class was generated from the following files: