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);
77 const std::string& getType()
const;
83 State getState()
const;
101 void removeConnector(
Connector* connector);
104 std::vector<Connector*> getInputConnectors()
const;
107 std::vector<Connector*> getOutputConnectors()
const;
110 bool isValid(std::string& errorMessage)
const;
121 bool checkConnectorsAreReady();
124 void pushParametersToConnectors();
127 void checkForReadyToRun();
130 virtual void runImpl() = 0;
170 TaskFactory(
const std::string& taskType,
const std::string& category);
176 static std::vector<std::string> getCategories();
179 static std::vector<std::string> getTasksFromCategory(
const std::string& category);
192 #endif // __TERRALIB_PROCESS_INTERNAL_TASK_H Configuration flags for TerraLib Process.
This class defines the interface of abstract factories without initializing parameters.
std::string m_taskType
The type of the task. Used by the factory.
This class represents the description of a parameter.
std::unique_ptr< TaskParameters > m_parameters
std::vector< Connector * > m_connectors
Represents the capabilities of a task.
te::da::DataSourceCapabilities capabilities
static std::map< std::string, std::vector< std::string > > m_mapCategories
Abstraction that represents a Connector between parameters of a Task.
std::string m_id
The ID of the task.
Wrapper function used to create taks. Used to avoid C++ to create multiple instances of the factory s...
TEPROCESSEXPORT Task * CreateTask(const std::string &taskType)
std::unique_ptr< TaskCapabilities > m_capabilities