source: XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp @ 1680

Last change on this file since 1680 was 1680, checked in by yushan, 5 years ago

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1676. Arithmetic filter unified

File size: 1.5 KB
Line 
1#include "pass_through_filter.hpp"
2#include "workflow_graph.hpp"
3#include "field.hpp"
4#include "file.hpp"
5
6namespace xios
7{
8  CPassThroughFilter::CPassThroughFilter(CGarbageCollector& gc)
9    : CFilter(gc, 1, this)
10  { 
11  }
12
13  CDataPacketPtr CPassThroughFilter::apply(std::vector<CDataPacketPtr> data)
14  {
15        bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;
16
17    if(building_graph)
18    {
19      // std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl;
20      this->filterID = InvalidableObject::filterIdGenerator++;
21      int edgeID = InvalidableObject::edgeIdGenerator++;
22
23      CWorkflowGraph::allocNodeEdge();
24
25      CWorkflowGraph::addNode(this->filterID, "Pass Through Filter", 2, 1, 1, data[0]);
26
27      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes();
28      if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes();
29
30     
31      if(CWorkflowGraph::build_begin)
32      {
33        CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);
34        (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0;
35      }
36      else CWorkflowGraph::build_begin = true;
37     
38      data[0]->src_filterID=this->filterID;
39
40    }
41    data[0]->field = this->field;
42   
43
44    return data[0];
45  }
46
47} // namespace xios
Note: See TracBrowser for help on using the repository browser.