source: XIOS/dev/dev_ym/XIOS_COUPLING/src/workflow_graph.hpp @ 2230

Last change on this file since 2230 was 2193, checked in by yushan, 3 years ago

workflow graph : enable unary and binary arithmetic filters

File size: 2.6 KB
Line 
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"
10#include "context.hpp"
11
12namespace xios
13{
14  class CField;
15
16  struct graph_node_object
17  {
18    StdString filter_name;
19
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;
32    StdString context_id;
33    int context;
34    StdString label_field_id;
35    bool show;
36
37
38    graph_node_object():show(true){}
39
40  };
41
42  struct graph_edge_object
43  {
44    int from;
45    int to;
46
47    StdString field_id;
48    StdString field_name;
49    StdString grid_id;
50    CDate date;
51    Time timestamp;
52    CField *field;
53    StdString attributes;
54    StdString context_id;
55    int context;
56    bool show;
57    StdString label_info;
58   
59    graph_edge_object():show(true), label_info("none"){}
60  };
61
62  class CWorkflowGraph
63  {
64    public:
65
66      CWorkflowGraph();
67
68      /*! Map between fields identified by its id and their filters identified by an integer.
69       * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()).
70      */
71
72      static std::vector<graph_node_object> *vectorOfNodes_;
73      static std::vector<graph_edge_object> *vectorOfEdges_; 
74      static std::vector<StdString> *vectorOfContexts_; 
75
76      static std::vector<graph_node_object> *vectorOfNodes_srv_;
77      static std::vector<graph_edge_object> *vectorOfEdges_srv_;
78      static std::vector<StdString> *vectorOfContexts_srv_; 
79
80      static std::unordered_map <size_t, int> *mapHashFilterID_;
81      static std::unordered_map <size_t, int> *mapHashFilterID_srv_;
82
83      // these variables are not yet used
84      static bool clientGraphBuilt;
85      static bool serverGraphBuilt;
86      static bool build_begin;
87
88
89      static void drawWorkFlowGraph_client();
90      static void drawWorkFlowGraph_server();
91
92
93      static void addNode(StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet);
94      static void addEdge(int from, int to, CDataPacketPtr packet);
95     
96      // write to file the graph info
97      static void outputWorkflowGraph_client();
98      static void outputWorkflowGraph_server();
99     
100      // output on screen the graph info
101      static void outputWorkflowGraph_client_stdout();
102      static void outputWorkflowGraph_server_stdout();
103
104      static int  getNodeSize();
105
106  };
107
108}
109
110#endif
111
Note: See TracBrowser for help on using the repository browser.