This class represents the description of a parameter. More...
#include <Task.h>
Public Types | |
enum class | State { NOT_INITIALIZED , MISSING_PARAMETERS , READY_TO_RUN , RUNNING , FINISHED , FINISHED_WITH_ERRORS } |
Public Member Functions | |
void | addConnector (Connector *connector) |
Removes a parameter connector to this class. More... | |
const TaskCapabilities * | getCapabilities () const |
Gets the current execution state of the task. More... | |
const std::string & | getId () const |
std::vector< Connector * > | getInputConnectors () const |
Gets all the output connectors. More... | |
std::vector< Connector * > | getOutputConnectors () const |
Checks if the task is valid, that is, if all the required input parameters have values OR connectors associated to them. More... | |
const te::process::ParameterValue * | getParameter (std::size_t index) const |
Sets the index-th parameter. This object will optionally take the ownership of the value pointer. More... | |
State | getState () const |
Gets the index-th parameter. More... | |
const TaskParameters * | getTaskParameters () const |
Sets the task paramters. This class will take the ownership of the given pointer. More... | |
const std::string & | getType () const |
Gets the capabilities of the task. More... | |
bool | isValid (std::string &errorMessage) const |
Runs the task. More... | |
void | removeConnector (Connector *connector) |
Gets all the input connectors. More... | |
void | run () |
void | setId (const std::string &id) |
Gets the type of the task. More... | |
void | setParameter (std::size_t index, te::process::ParameterValue *value, bool takeOwnership) |
Gets the task paramters. More... | |
void | setTaskParameters (TaskParameters *taskParameters) |
Adds a parameter connector to this class. More... | |
Task (const std::string &taskType) | |
It initializes the Task. More... | |
virtual | ~Task () |
Virtual destructor. More... | |
Protected Member Functions | |
bool | checkConnectorsAreReady () |
Pushes the parameters into the output connectors. More... | |
void | checkForReadyToRun () |
Runs the task. More... | |
void | init (TaskCapabilities *capabilities) |
< Initializes the task. This function must be called by any class that extends this abstraction. The abstraction will take the ownership of the pointer More... | |
void | pushParametersToConnectors () |
This function is called whenever the parameters are changed and is responsible for checking the parameters are valid. If they are, change the task state to Ready to Run. More... | |
virtual void | runImpl ()=0 |
Protected Attributes | |
std::unique_ptr< TaskCapabilities > | m_capabilities |
std::vector< Connector * > | m_connectors |
std::string | m_id |
The ID of the task. More... | |
std::unique_ptr< TaskParameters > | m_parameters |
State | m_state |
std::string | m_taskType |
The type of the task. Used by the factory. More... | |
This class represents the description of a parameter.
This class is a holder for all the task input and output parameters.
Abstraction that represents a Task that can be executed.
This class represents the value of a parameter.
|
strong |
te::process::Task::Task | ( | const std::string & | taskType | ) |
It initializes the Task.
|
virtual |
Virtual destructor.
Gets the id of the task
void te::process::Task::addConnector | ( | Connector * | connector | ) |
Removes a parameter connector to this class.
|
protected |
Pushes the parameters into the output connectors.
|
protected |
Runs the task.
const TaskCapabilities* te::process::Task::getCapabilities | ( | ) | const |
Gets the current execution state of the task.
const std::string& te::process::Task::getId | ( | ) | const |
std::vector<Connector*> te::process::Task::getInputConnectors | ( | ) | const |
Gets all the output connectors.
std::vector<Connector*> te::process::Task::getOutputConnectors | ( | ) | const |
Checks if the task is valid, that is, if all the required input parameters have values OR connectors associated to them.
const te::process::ParameterValue* te::process::Task::getParameter | ( | std::size_t | index | ) | const |
Sets the index-th parameter. This object will optionally take the ownership of the value pointer.
State te::process::Task::getState | ( | ) | const |
Gets the index-th parameter.
const TaskParameters* te::process::Task::getTaskParameters | ( | ) | const |
Sets the task paramters. This class will take the ownership of the given pointer.
const std::string& te::process::Task::getType | ( | ) | const |
Gets the capabilities of the task.
|
protected |
< Initializes the task. This function must be called by any class that extends this abstraction. The abstraction will take the ownership of the pointer
Checks if all the input connectors are ready. If at least one connector is not ready, it returns FALSE.
bool te::process::Task::isValid | ( | std::string & | errorMessage | ) | const |
Runs the task.
|
protected |
This function is called whenever the parameters are changed and is responsible for checking the parameters are valid. If they are, change the task state to Ready to Run.
void te::process::Task::removeConnector | ( | Connector * | connector | ) |
Gets all the input connectors.
void te::process::Task::run | ( | ) |
|
protectedpure virtual |
Implemented in te::process::DataStoreTask, and te::process::DataAccessTask.
void te::process::Task::setId | ( | const std::string & | id | ) |
Gets the type of the task.
void te::process::Task::setParameter | ( | std::size_t | index, |
te::process::ParameterValue * | value, | ||
bool | takeOwnership | ||
) |
Gets the task paramters.
void te::process::Task::setTaskParameters | ( | TaskParameters * | taskParameters | ) |
Adds a parameter connector to this class.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |