source: XIOS/dev/dev_trunk_graph/src/workflow_graph.hpp @ 2028

Last change on this file since 2028 was 2028, checked in by yushan, 9 months ago

Graph intermediate commit to a tmp branch.

File size: 2.5 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      // these variables are not yet used
81      static bool clientGraphBuilt;
82      static bool serverGraphBuilt;
83      static bool build_begin;
84
85
86      static void drawWorkFlowGraph_client();
87      static void drawWorkFlowGraph_server();
88
89
90      static void addNode(StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet);
91      static void addEdge(int from, int to, CDataPacketPtr packet);
92     
93      // write to file the graph info
94      static void outputWorkflowGraph_client();
95      static void outputWorkflowGraph_server();
96     
97      // output on screen the graph info
98      static void outputWorkflowGraph_client_stdout();
99      static void outputWorkflowGraph_server_stdout();
100
101      static int  getNodeSize();
102
103  };
104
105}
106
107#endif
108
Note: See TracBrowser for help on using the repository browser.