Pakman
TaskHandler Class Reference

#include <TaskHandler.h>

Public Types

enum  state_t { pending, finished }
 

Public Member Functions

 TaskHandler (const std::string &input_string)
 
 TaskHandler (TaskHandler &&t)
 
 ~TaskHandler ()=default
 
state_t getState () const
 
bool isPending () const
 
bool isFinished () const
 
bool didErrorOccur () const
 
int getErrorCode () const
 
std::string getInputString () const
 
std::string getOutputString () const
 
void recordOutputAndErrorCode (const std::string &output_string, int error_code)
 

Detailed Description

A class for representing tasks.

A task represents a simulation job, which consists of spawning a simulator, feeding it some input and retrieving the output.

Definition at line 11 of file TaskHandler.h.

Member Enumeration Documentation

◆ state_t

Enumeration type for TaskHandler states.

Definition at line 16 of file TaskHandler.h.

Constructor & Destructor Documentation

◆ TaskHandler() [1/2]

TaskHandler::TaskHandler ( const std::string &  input_string)

Construct from input string.

Parameters
input_stringinput string to simulator.

Definition at line 4 of file TaskHandler.cc.

◆ TaskHandler() [2/2]

TaskHandler::TaskHandler ( TaskHandler &&  t)

Move constructor.

Definition at line 10 of file TaskHandler.cc.

◆ ~TaskHandler()

TaskHandler::~TaskHandler ( )
default

Default destructor does nothing.

Member Function Documentation

◆ didErrorOccur()

bool TaskHandler::didErrorOccur ( ) const
Returns
whether error occurred.

Definition at line 37 of file TaskHandler.cc.

◆ getErrorCode()

int TaskHandler::getErrorCode ( ) const
Returns
error code that simulation job returned.

Definition at line 60 of file TaskHandler.cc.

◆ getInputString()

std::string TaskHandler::getInputString ( ) const
Returns
input string.

Definition at line 46 of file TaskHandler.cc.

◆ getOutputString()

std::string TaskHandler::getOutputString ( ) const
Returns
output string.

Definition at line 53 of file TaskHandler.cc.

◆ getState()

TaskHandler::state_t TaskHandler::getState ( ) const
Returns
state of TaskHandler.

Definition at line 19 of file TaskHandler.cc.

◆ isFinished()

bool TaskHandler::isFinished ( ) const
Returns
whether task is finished.

Definition at line 31 of file TaskHandler.cc.

◆ isPending()

bool TaskHandler::isPending ( ) const
Returns
whether task is pending.

Definition at line 25 of file TaskHandler.cc.

◆ recordOutputAndErrorCode()

void TaskHandler::recordOutputAndErrorCode ( const std::string &  output_string,
int  error_code 
)

Record output and error code.

Parameters
output_stringthe output string that the simulation job returned.
error_codethe error code that the simulation job returned.

Definition at line 67 of file TaskHandler.cc.


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