- Timestamp:
- 06/25/19 16:14:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp
r643 r1677 1 1 #include "unary_arithmetic_filter.hpp" 2 2 #include "workflow_graph.hpp" 3 3 namespace xios 4 4 { … … 6 6 : CFilter(gc, 1, this) 7 7 , op(operatorExpr.getOpField(op)) 8 { /* Nothing to do */ }; 8 { 9 StdString input_op_expression=op; 10 if(input_op_expression == "neg") 11 op_expression = "-"; 12 else if(input_op_expression == "sin") 13 op_expression = "sin"; 14 else if(input_op_expression == "cos") 15 op_expression = "cos"; 16 else if(input_op_expression == "tan") 17 op_expression = "tan"; 18 else if(input_op_expression == "exp") 19 op_expression = "exp"; 20 else if(input_op_expression == "log") 21 op_expression = "log"; 22 else if(input_op_expression == "log10") 23 op_expression = "log10"; 24 else if(input_op_expression == "sqrt") 25 op_expression = "sqrt"; 26 else 27 op_expression = " "; 28 }; 9 29 10 30 CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 11 31 { 32 if(this->tag) 33 { 34 this->filterID = InvalidableObject::filterIdGenerator++; 35 36 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 37 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 38 39 40 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = op_expression +" F Filter" ; 41 std::cout<<"CunaryArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 42 43 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 44 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 45 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 46 47 } 48 12 49 CDataPacketPtr packet(new CDataPacket); 13 50 packet->date = data[0]->date; 14 51 packet->timestamp = data[0]->timestamp; 15 52 packet->status = data[0]->status; 53 packet->fieldID = this->output_field_id; 16 54 17 55 if (packet->status == CDataPacket::NO_ERROR) 18 56 packet->data.reference(op(data[0]->data)); 19 57 58 if(this->tag) packet->src_filterID = this->filterID; 59 20 60 return packet; 21 61 }
Note: See TracChangeset
for help on using the changeset viewer.