Go to the documentation of this file.
26 #ifndef __TERRALIB_PROCESS_INTERNAL_TASK_H
27 #define __TERRALIB_PROCESS_INTERNAL_TASK_H
32 #include "../common/AbstractFactory.h"
45 class TaskCapabilities;
59 NOT_INITIALIZED, MISSING_PARAMETERS, READY_TO_RUN, RUNNING, FINISHED, FINISHED_WITH_ERRORS
65 Task(
const std::string& taskType);
71 const std::string&
getId()
const;
74 void setId(
const std::string&
id);
110 bool isValid(std::string& errorMessage)
const;
170 TaskFactory(
const std::string& taskType,
const std::string& category);
192 #endif // __TERRALIB_PROCESS_INTERNAL_TASK_H
TaskPtr(te::process::Task *task=nullptr)
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.
std::vector< Connector * > m_connectors
This class defines the interface of abstract factories without initializing parameters.
std::vector< Connector * > getInputConnectors() const
Gets all the output connectors.
void setId(const std::string &id)
Gets the type of the task.
virtual ~Task()
Virtual destructor.
Wrapper function used to create taks. Used to avoid C++ to create multiple instances of the factory s...
void addConnector(Connector *connector)
Removes a parameter connector to this class.
This class represents the description of a parameter.
void init(TaskCapabilities *capabilities)
< Initializes the task. This function must be called by any class that extends this abstraction....
void setParameter(std::size_t index, te::process::ParameterValue *value, bool takeOwnership)
Gets the task paramters.
virtual ~TaskFactory()
Gets all registered categories.
Represents the capabilities of a task.
void setTaskParameters(TaskParameters *taskParameters)
Adds a parameter connector to this class.
Task(const std::string &taskType)
It initializes the Task.
TEPROCESSEXPORT Task * CreateTask(const std::string &taskType)
te::da::DataSourceCapabilities capabilities
std::string m_id
The ID of the task.
static std::vector< std::string > getTasksFromCategory(const std::string &category)
static std::vector< std::string > getCategories()
Gets all tasks from the give category.
const std::string & getType() const
Gets the capabilities of the task.
void removeConnector(Connector *connector)
Gets all the input connectors.
TaskFactory(const std::string &taskType, const std::string &category)
Constructor.
std::unique_ptr< TaskParameters > m_parameters
std::unique_ptr< TaskCapabilities > m_capabilities
TaskSharedPtr(te::process::Task *task=nullptr)
const TaskCapabilities * getCapabilities() const
Gets the current execution state of the task.
const std::string & getId() const
State getState() const
Gets the index-th parameter.
void pushParametersToConnectors()
This function is called whenever the parameters are changed and is responsible for checking the param...
void checkForReadyToRun()
Runs the task.
std::vector< Connector * > getOutputConnectors() const
Checks if the task is valid, that is, if all the required input parameters have values OR connectors ...
const TaskParameters * getTaskParameters() const
Sets the task paramters. This class will take the ownership of the given pointer.
bool checkConnectorsAreReady()
Pushes the parameters into the output connectors.
Proxy configuration file for TerraView (see terraview_config.h).
std::string m_taskType
The type of the task. Used by the factory.
Abstraction that represents a Connector between parameters of a Task.
static std::map< std::string, std::vector< std::string > > m_mapCategories
bool isValid(std::string &errorMessage) const
Runs the task.