[1704] | 1 | #ifndef __WORKFLOW_GRAPH_HPP__ |
---|
| 2 | #define __WORKFLOW_GRAPH_HPP__ |
---|
| 3 | |
---|
| 4 | #include "xios_spl.hpp" |
---|
| 5 | #include "field.hpp" |
---|
| 6 | #include "grid.hpp" |
---|
| 7 | #include "garbage_collector.hpp" |
---|
| 8 | #include "date.hpp" |
---|
| 9 | #include "duration.hpp" |
---|
[1877] | 10 | #include "context.hpp" |
---|
[1704] | 11 | |
---|
| 12 | namespace xios |
---|
| 13 | { |
---|
| 14 | class CField; |
---|
| 15 | |
---|
| 16 | struct graph_info_box_node |
---|
| 17 | { |
---|
| 18 | |
---|
| 19 | StdString filter_name; |
---|
| 20 | int filter_class; |
---|
| 21 | bool filter_filled; |
---|
| 22 | int expected_entry_nb; |
---|
| 23 | CDate date; |
---|
| 24 | Time timestamp; |
---|
| 25 | StdString transform_type; |
---|
| 26 | StdString attributes; |
---|
| 27 | StdString field_id; |
---|
| 28 | bool inputs_complete; |
---|
| 29 | int filter_tag; |
---|
| 30 | int clusterID; |
---|
| 31 | int distance; |
---|
[1877] | 32 | StdString node_context_id; |
---|
[1704] | 33 | }; |
---|
| 34 | |
---|
| 35 | struct graph_info_box_edge |
---|
| 36 | { |
---|
| 37 | int from; |
---|
| 38 | int to; |
---|
| 39 | StdString field_id; |
---|
| 40 | StdString field_name; |
---|
| 41 | StdString grid_id; |
---|
| 42 | CDate date; |
---|
| 43 | Time timestamp; |
---|
| 44 | CField *field; |
---|
| 45 | StdString attributes; |
---|
[1877] | 46 | StdString edge_context_id; |
---|
[1704] | 47 | }; |
---|
| 48 | |
---|
| 49 | class CWorkflowGraph |
---|
| 50 | { |
---|
| 51 | |
---|
| 52 | friend class CGraphviz; |
---|
| 53 | |
---|
| 54 | public: |
---|
| 55 | |
---|
| 56 | CWorkflowGraph(); |
---|
| 57 | |
---|
| 58 | /*! Map between fields identified by its id and their filters identified by an integer. |
---|
| 59 | * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()). |
---|
| 60 | */ |
---|
| 61 | // static std::unordered_map <StdString, vector <int> > *mapFieldToFilters_ptr; |
---|
| 62 | // #pragma omp threadprivate(mapFieldToFilters_ptr) |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | static std::unordered_map <int, graph_info_box_node> *mapFilters_ptr_with_info; |
---|
| 67 | |
---|
| 68 | static std::unordered_map <int, graph_info_box_edge> *mapFieldToFilters_ptr_with_info; |
---|
| 69 | |
---|
| 70 | static std::unordered_map <size_t, int> *mapHashFilterID_ptr; |
---|
[1877] | 71 | |
---|
| 72 | static std::unordered_map <StdString, int> *mapContext_ptr; |
---|
[1704] | 73 | |
---|
| 74 | |
---|
| 75 | static bool build_begin; |
---|
| 76 | |
---|
| 77 | static void addNode(int nodeID, StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet); |
---|
| 78 | static void addEdge(int edgeID, int toID, CDataPacketPtr packet); |
---|
| 79 | static void allocNodeEdge(); |
---|
| 80 | |
---|
| 81 | private: |
---|
| 82 | |
---|
| 83 | //! List of fields marked for visualizing of their workflow |
---|
| 84 | static vector <StdString> fields; |
---|
| 85 | |
---|
| 86 | //! List of connected filters for fields for visualizing of their workflow |
---|
| 87 | static vector <StdString> filters; |
---|
| 88 | |
---|
| 89 | //! Fields to filters connectivity |
---|
| 90 | static vector <pair<int, int> > fieldsToFilters; |
---|
| 91 | |
---|
| 92 | static void buildStaticWorkflow(); |
---|
| 93 | static void buildStaticWorkflow_with_info(); |
---|
| 94 | static void showStaticWorkflow(); |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | }; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | #endif |
---|