Changeset 1677 for XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
- Timestamp:
- 06/25/19 16:14:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
r1671 r1677 4 4 #include "utils.hpp" 5 5 #include "workflow_graph.hpp" 6 #include "graphviz.hpp" 7 8 using namespace ep_lib; 6 9 7 10 namespace xios … … 14 17 ERROR("CFileWriterFilter::CFileWriterFilter(CField* field)", 15 18 "The field cannot be null."); 16 if (buildWorkflowGraph)17 {18 filterId = InvalidableObject::count;19 InvalidableObject::count++;20 }21 19 } 22 20 23 21 void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 24 22 { 23 if(this->tag) 24 { 25 this->filterID = InvalidableObject::filterIdGenerator++; 26 27 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 28 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 29 30 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "File Writer Filter"; 31 32 if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<std::endl; 33 34 if(CXios::isClient) 35 { 36 StdString str = this->output_field_id +" ts=" + to_string(data[0]->timestamp); 37 // StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 38 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 39 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 40 } 41 } 42 25 43 const bool detectMissingValue = ( !field->default_value.isEmpty() && 26 44 ( (!field->detect_missing_value.isEmpty() || field->detect_missing_value == true) … … 41 59 42 60 field->sendUpdateData(dataArray); 61 62 63 43 64 } 44 65 … … 53 74 } 54 75 55 int CFileWriterFilter::getFilterId(void) 56 { 57 return filterId; 58 } 76 59 77 60 78 } // namespace xios
Note: See TracChangeset
for help on using the changeset viewer.