Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
Task.hpp
Go to the documentation of this file.
1#pragma once
2#include <fishnet/StopWatch.h>
3#include <spdlog/spdlog.h>
4
10class Task {
11private:
12 std::string taskName;
14protected:
15 size_t workflowID = 0;
16public:
17 Task(std::string taskName):taskName(std::move(taskName)){
18 spdlog::info("Launching {}",this->taskName);
19 }
20
21 Task(std::string taskName, size_t workflowID):taskName(std::move(taskName)), workflowID(workflowID){
22 spdlog::info("Launching {} with workflow id {}",this->taskName,workflowID);
23 }
24
25 constexpr static std::string FISHNET_ID_FIELD = "FISHNET_ID";
26
27 virtual ~Task(){
28 double duration =stopWatch.stop();
29 spdlog::info("Completed {}", this->taskName);
30 spdlog::info("Time elapsed in seconds:{}",duration);
31 }
32};
Common super class for all tasks Execution time is tracked, Brings logger into scope RAII type -> exe...
Definition Task.hpp:10
static constexpr std::string FISHNET_ID_FIELD
Definition Task.hpp:25
virtual ~Task()
Definition Task.hpp:27
Task(std::string taskName, size_t workflowID)
Definition Task.hpp:21
size_t workflowID
Definition Task.hpp:15
Task(std::string taskName)
Definition Task.hpp:17
StopWatch class to track execution time of a task. Time can be tracked explicitly (....
Definition StopWatch.h:10
double stop()
Definition StopWatch.cpp:13
STL namespace.