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