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
RevLine 
[641]1#include "pass_through_filter.hpp"
[1677]2#include "workflow_graph.hpp"
[1679]3#include "field.hpp"
[1680]4#include "file.hpp"
[641]5
6namespace xios
7{
[1679]8  CPassThroughFilter::CPassThroughFilter(CGarbageCollector& gc)
9    : CFilter(gc, 1, this)
[1677]10  { 
11  }
[641]12
13  CDataPacketPtr CPassThroughFilter::apply(std::vector<CDataPacketPtr> data)
14  {
[1679]15        bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;
16
17    if(building_graph)
[1677]18    {
[1680]19      // std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl;
[1677]20      this->filterID = InvalidableObject::filterIdGenerator++;
[1679]21      int edgeID = InvalidableObject::edgeIdGenerator++;
[1677]22
[1680]23      CWorkflowGraph::allocNodeEdge();
[1677]24
[1680]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
[1677]30     
[1679]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     
[1677]38      data[0]->src_filterID=this->filterID;
39
40    }
[1679]41    data[0]->field = this->field;
[1677]42   
43
[641]44    return data[0];
45  }
[1677]46
[641]47} // namespace xios
Note: See TracBrowser for help on using the repository browser.