19 #include <unordered_map> 21 #include "containers.h" 26 template <
class TMemInterface >
class base_thread_pool;
35 typedef std::vector< task_type *, stl_allocator< task_type *, TMemInterface > > task_vector;
38 typedef std::function< void(task_type *, void *&) > traversal_function_type;
52 void load(string_type _file_name);
59 void setup_task(task_type *_task, uint32_t _task_file_field, string_type str);
67 template <
class TMemInterface >
75 using namespace std::placeholders;
78 tifstream task_file(_file_name.c_str(), std::ios::in);
79 assert(task_file.is_open());
80 while (getline(task_file, line))
84 istringstream_type iss(line);
87 unsigned int _task_file_field = 0;
88 while (getline(iss, token, _t(
',')))
90 tcout << token << std::endl;
100 for (
auto &task_name : task->debug.dependent_task_names)
105 task->persistent.dependent_tasks.push_back(dependent_task->second);
106 dependent_task->second->persistent.parent_tasks.push_back(task);
110 tcout <<
"Cannot link" << task->debug.task_name <<
" to " << task_name <<
'\n';
116 template <
class TMemInterface >
131 switch (_task_file_field)
138 transform(_str.begin(), _str.end(), _str.begin(), ::toupper);
139 for (
auto i = 0; i < task_type::num_priority; i++)
142 static_cast< typename task_type::priority_selector >(i))) == 0)
Definition: workertask.h:23
base_task_graph_helper(task_graph_type &_task_graph)
Initializes a new instance of the base_task_graph_helper class.
Definition: taskgraphhelper.h:68
task_graph_type & task_graph
The task graph
Definition: taskgraphhelper.h:64
Class stl_allocator.
Definition: allocator.h:16
void setup_task(task_type *_task, uint32_t _task_file_field, string_type str)
Setups the task.
Definition: taskgraphhelper.h:117
Definition: allocator.h:17
string_vector dependent_task_names
The dependent task names
Definition: task.h:98
task_vector task_list
The task list
Definition: taskgraph.h:152
priority_selector task_priority
The task priority
Definition: task.h:162
void load(string_type _file_name)
Loads the specified file name.
Definition: taskgraphhelper.h:73
const tchar_t * priority_to_string(priority_selector _priority) const
Priorities to string.
Definition: task.h:293
string_type task_name
The task name
Definition: task.h:94
debug_container debug
The debug
Definition: taskgraph.h:281
Class base_task.
Definition: task.h:44
Class base_task_graph.
Definition: task.h:35
debug_container debug
The debug
Definition: task.h:255
Definition: taskgraphhelper.h:28
Class base_thread_pool.
Definition: task.h:36
task_name_to_task_map task_name_to_task
The task name to task
Definition: taskgraph.h:148
persistent_container persistent
The persistent
Definition: task.h:263
priority_selector
Enum priority_selector
Definition: task.h:70