[1162] | 1 | #include "ternary_arithmetic_filter.hpp" |
---|
[1677] | 2 | #include "workflow_graph.hpp" |
---|
[1680] | 3 | #include "yacc_var.hpp" |
---|
[1681] | 4 | #include "file.hpp" |
---|
[1162] | 5 | |
---|
| 6 | namespace xios |
---|
| 7 | { |
---|
| 8 | CScalarScalarFieldArithmeticFilter::CScalarScalarFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value1, double value2) |
---|
| 9 | : CFilter(gc, 1, this) |
---|
| 10 | , op(operatorExpr.getOpScalarScalarField(op)) |
---|
| 11 | , value1(value1) |
---|
| 12 | , value2(value2) |
---|
[1680] | 13 | { |
---|
| 14 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 15 | /* Nothing to do */ |
---|
| 16 | }; |
---|
[1162] | 17 | |
---|
[1681] | 18 | std::tuple<int, int, int> CScalarScalarFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 19 | { |
---|
[1681] | 20 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 21 | int unique_filter_id; |
---|
| 22 | bool firstround; |
---|
| 23 | |
---|
[1679] | 24 | if(building_graph) |
---|
[1677] | 25 | { |
---|
[1680] | 26 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 27 | |
---|
[1681] | 28 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 29 | |
---|
[1681] | 30 | // first round |
---|
| 31 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
| 32 | { |
---|
| 33 | firstround = true; |
---|
| 34 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 35 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 36 | |
---|
[1681] | 37 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 38 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 39 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1679] | 40 | |
---|
[1680] | 41 | |
---|
[1681] | 42 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 43 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 44 | |
---|
[1680] | 45 | |
---|
[1681] | 46 | if(CWorkflowGraph::build_begin) |
---|
| 47 | { |
---|
| 48 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 49 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 50 | |
---|
[1681] | 51 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 52 | } |
---|
| 53 | else CWorkflowGraph::build_begin = true; |
---|
[1679] | 54 | |
---|
[1681] | 55 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 56 | unique_filter_id = this->filterID; |
---|
[1679] | 57 | } |
---|
[1681] | 58 | // not first round |
---|
| 59 | else |
---|
| 60 | { |
---|
| 61 | firstround=false; |
---|
| 62 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 63 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 64 | { |
---|
| 65 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 66 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 67 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 68 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 69 | } |
---|
| 70 | } |
---|
[1677] | 71 | } |
---|
| 72 | |
---|
[1681] | 73 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 77 | { |
---|
[1162] | 78 | CDataPacketPtr packet(new CDataPacket); |
---|
| 79 | packet->date = data[0]->date; |
---|
| 80 | packet->timestamp = data[0]->timestamp; |
---|
| 81 | packet->status = data[0]->status; |
---|
[1681] | 82 | |
---|
| 83 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 84 | |
---|
| 85 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 86 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 87 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 88 | |
---|
[1679] | 89 | packet->field = this->field; |
---|
[1162] | 90 | |
---|
| 91 | if (packet->status == CDataPacket::NO_ERROR) |
---|
| 92 | packet->data.reference(op(value1,value2, data[0]->data)); |
---|
| 93 | |
---|
| 94 | return packet; |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | CScalarFieldScalarArithmeticFilter::CScalarFieldScalarArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value1, double value2) |
---|
| 98 | : CFilter(gc, 1, this) |
---|
| 99 | , op(operatorExpr.getOpScalarFieldScalar(op)) |
---|
| 100 | , value1(value1) |
---|
| 101 | , value2(value2) |
---|
[1680] | 102 | { |
---|
| 103 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 104 | /* Nothing to do */ |
---|
| 105 | }; |
---|
[1162] | 106 | |
---|
[1681] | 107 | std::tuple<int, int, int> CScalarFieldScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 108 | { |
---|
[1681] | 109 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 110 | int unique_filter_id; |
---|
| 111 | bool firstround; |
---|
| 112 | |
---|
[1679] | 113 | if(building_graph) |
---|
[1677] | 114 | { |
---|
[1680] | 115 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 116 | |
---|
[1681] | 117 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 118 | |
---|
[1681] | 119 | // first round |
---|
| 120 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
| 121 | { |
---|
| 122 | firstround = true; |
---|
| 123 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 124 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 125 | |
---|
[1681] | 126 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 127 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 128 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1680] | 129 | |
---|
| 130 | |
---|
[1681] | 131 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 132 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 133 | |
---|
[1679] | 134 | |
---|
[1681] | 135 | if(CWorkflowGraph::build_begin) |
---|
| 136 | { |
---|
| 137 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 138 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
| 139 | |
---|
| 140 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 141 | } |
---|
| 142 | else CWorkflowGraph::build_begin = true; |
---|
| 143 | |
---|
| 144 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 145 | unique_filter_id = this->filterID; |
---|
[1679] | 146 | } |
---|
[1681] | 147 | // not first round |
---|
| 148 | else |
---|
| 149 | { |
---|
| 150 | firstround=false; |
---|
| 151 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 152 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 153 | { |
---|
| 154 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 155 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 156 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 157 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 158 | } |
---|
| 159 | } |
---|
[1677] | 160 | } |
---|
| 161 | |
---|
[1681] | 162 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 163 | } |
---|
| 164 | |
---|
| 165 | CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 166 | { |
---|
[1162] | 167 | CDataPacketPtr packet(new CDataPacket); |
---|
| 168 | packet->date = data[0]->date; |
---|
| 169 | packet->timestamp = data[0]->timestamp; |
---|
| 170 | packet->status = data[0]->status; |
---|
[1681] | 171 | |
---|
| 172 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 173 | |
---|
| 174 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 175 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 176 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 177 | |
---|
[1679] | 178 | packet->field = this->field; |
---|
[1162] | 179 | |
---|
| 180 | if (packet->status == CDataPacket::NO_ERROR) |
---|
| 181 | packet->data.reference(op(value1, data[0]->data,value2)); |
---|
| 182 | |
---|
| 183 | return packet; |
---|
| 184 | } |
---|
| 185 | |
---|
| 186 | CScalarFieldFieldArithmeticFilter::CScalarFieldFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value) |
---|
| 187 | : CFilter(gc, 2, this) |
---|
| 188 | , op(operatorExpr.getOpScalarFieldField(op)) |
---|
| 189 | , value(value) |
---|
[1680] | 190 | { |
---|
| 191 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 192 | /* Nothing to do */ |
---|
| 193 | }; |
---|
[1162] | 194 | |
---|
[1681] | 195 | std::tuple<int, int, int> CScalarFieldFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 196 | { |
---|
[1681] | 197 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 198 | int unique_filter_id; |
---|
| 199 | |
---|
| 200 | bool firstround; |
---|
| 201 | |
---|
[1679] | 202 | if(building_graph) |
---|
[1681] | 203 | { |
---|
[1680] | 204 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 205 | |
---|
[1681] | 206 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 207 | |
---|
[1681] | 208 | // first round |
---|
| 209 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
| 210 | { |
---|
| 211 | firstround = true; |
---|
| 212 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 213 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 214 | |
---|
| 215 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 216 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 217 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1677] | 218 | |
---|
[1681] | 219 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 220 | |
---|
| 221 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 222 | if(CWorkflowGraph::build_begin) |
---|
| 223 | { |
---|
[1680] | 224 | |
---|
[1681] | 225 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 226 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 227 | |
---|
[1681] | 228 | edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 229 | |
---|
[1681] | 230 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); |
---|
| 231 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 232 | |
---|
[1681] | 233 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 234 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 235 | } |
---|
| 236 | CWorkflowGraph::build_begin = true; |
---|
[1679] | 237 | |
---|
[1681] | 238 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 239 | unique_filter_id = this->filterID; |
---|
| 240 | |
---|
[1679] | 241 | } |
---|
[1681] | 242 | // not first round |
---|
| 243 | else |
---|
| 244 | { |
---|
| 245 | firstround = false; |
---|
| 246 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 247 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 248 | { |
---|
| 249 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 250 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 251 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 252 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 253 | } |
---|
| 254 | if(data[1]->src_filterID != unique_filter_id) |
---|
| 255 | { |
---|
| 256 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 257 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); |
---|
| 258 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 259 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 260 | } |
---|
| 261 | |
---|
| 262 | } |
---|
[1677] | 263 | } |
---|
| 264 | |
---|
[1681] | 265 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 266 | } |
---|
| 267 | |
---|
| 268 | CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 269 | { |
---|
[1162] | 270 | CDataPacketPtr packet(new CDataPacket); |
---|
| 271 | packet->date = data[0]->date; |
---|
| 272 | packet->timestamp = data[0]->timestamp; |
---|
| 273 | packet->status = data[0]->status; |
---|
[1681] | 274 | |
---|
| 275 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 276 | |
---|
| 277 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 278 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 279 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 280 | |
---|
[1679] | 281 | packet->field = this->field; |
---|
[1162] | 282 | |
---|
| 283 | if (data[0]->status != CDataPacket::NO_ERROR) |
---|
| 284 | packet->status = data[0]->status; |
---|
| 285 | else if (data[1]->status != CDataPacket::NO_ERROR) |
---|
| 286 | packet->status = data[1]->status; |
---|
| 287 | else |
---|
| 288 | { |
---|
| 289 | packet->status = CDataPacket::NO_ERROR; |
---|
| 290 | packet->data.reference(op(value, data[0]->data, data[1]->data)); |
---|
| 291 | } |
---|
| 292 | return packet; |
---|
| 293 | |
---|
| 294 | } |
---|
| 295 | |
---|
| 296 | |
---|
| 297 | CFieldScalarScalarArithmeticFilter::CFieldScalarScalarArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value1, double value2) |
---|
| 298 | : CFilter(gc, 1, this) |
---|
| 299 | , op(operatorExpr.getOpFieldScalarScalar(op)) |
---|
| 300 | , value1(value1) |
---|
| 301 | , value2(value2) |
---|
[1680] | 302 | { |
---|
| 303 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 304 | /* Nothing to do */ |
---|
| 305 | }; |
---|
[1162] | 306 | |
---|
[1681] | 307 | std::tuple<int, int, int> CFieldScalarScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 308 | { |
---|
[1681] | 309 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 310 | int unique_filter_id; |
---|
| 311 | bool firstround; |
---|
| 312 | |
---|
[1679] | 313 | if(building_graph) |
---|
[1677] | 314 | { |
---|
[1680] | 315 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 316 | |
---|
[1681] | 317 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 318 | |
---|
[1681] | 319 | // first round |
---|
| 320 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
[1679] | 321 | { |
---|
[1681] | 322 | firstround = true; |
---|
| 323 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 324 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 325 | |
---|
[1681] | 326 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 327 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 328 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1679] | 329 | |
---|
[1681] | 330 | |
---|
| 331 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 332 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 333 | |
---|
| 334 | |
---|
| 335 | if(CWorkflowGraph::build_begin) |
---|
| 336 | { |
---|
| 337 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 338 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
| 339 | |
---|
| 340 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 341 | } |
---|
| 342 | else CWorkflowGraph::build_begin = true; |
---|
| 343 | |
---|
| 344 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 345 | unique_filter_id = this->filterID; |
---|
[1679] | 346 | } |
---|
[1681] | 347 | // not first round |
---|
| 348 | else |
---|
| 349 | { |
---|
| 350 | firstround=false; |
---|
| 351 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 352 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 353 | { |
---|
| 354 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 355 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 356 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 357 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 358 | } |
---|
| 359 | } |
---|
[1677] | 360 | } |
---|
| 361 | |
---|
[1681] | 362 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 363 | } |
---|
| 364 | |
---|
| 365 | CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 366 | { |
---|
[1162] | 367 | CDataPacketPtr packet(new CDataPacket); |
---|
| 368 | packet->date = data[0]->date; |
---|
| 369 | packet->timestamp = data[0]->timestamp; |
---|
| 370 | packet->status = data[0]->status; |
---|
[1681] | 371 | |
---|
| 372 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 373 | |
---|
| 374 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 375 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 376 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 377 | |
---|
[1679] | 378 | packet->field = this->field; |
---|
[1162] | 379 | |
---|
| 380 | if (packet->status == CDataPacket::NO_ERROR) |
---|
| 381 | packet->data.reference(op(data[0]->data, value1, value2)); |
---|
| 382 | |
---|
| 383 | return packet; |
---|
| 384 | } |
---|
| 385 | |
---|
| 386 | |
---|
| 387 | CFieldScalarFieldArithmeticFilter::CFieldScalarFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value) |
---|
| 388 | : CFilter(gc, 2, this) |
---|
| 389 | , op(operatorExpr.getOpFieldScalarField(op)) |
---|
| 390 | , value(value) |
---|
[1680] | 391 | { |
---|
| 392 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 393 | /* Nothing to do */ |
---|
| 394 | }; |
---|
[1162] | 395 | |
---|
[1681] | 396 | std::tuple<int, int, int> CFieldScalarFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 397 | { |
---|
[1681] | 398 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 399 | int unique_filter_id; |
---|
| 400 | |
---|
| 401 | bool firstround; |
---|
| 402 | |
---|
[1679] | 403 | if(building_graph) |
---|
[1681] | 404 | { |
---|
[1680] | 405 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 406 | |
---|
[1681] | 407 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 408 | |
---|
[1681] | 409 | // first round |
---|
| 410 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
[1679] | 411 | { |
---|
[1681] | 412 | firstround = true; |
---|
| 413 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 414 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 415 | |
---|
| 416 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 417 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 418 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1679] | 419 | |
---|
[1681] | 420 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 421 | |
---|
| 422 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 423 | if(CWorkflowGraph::build_begin) |
---|
| 424 | { |
---|
[1679] | 425 | |
---|
[1681] | 426 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 427 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 428 | |
---|
[1681] | 429 | edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 430 | |
---|
[1681] | 431 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); |
---|
| 432 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
| 433 | |
---|
| 434 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 435 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 436 | } |
---|
| 437 | CWorkflowGraph::build_begin = true; |
---|
| 438 | |
---|
| 439 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 440 | unique_filter_id = this->filterID; |
---|
| 441 | |
---|
[1679] | 442 | } |
---|
[1681] | 443 | // not first round |
---|
| 444 | else |
---|
| 445 | { |
---|
| 446 | firstround = false; |
---|
| 447 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 448 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 449 | { |
---|
| 450 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 451 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 452 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 453 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 454 | } |
---|
| 455 | if(data[1]->src_filterID != unique_filter_id) |
---|
| 456 | { |
---|
| 457 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 458 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); |
---|
| 459 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 460 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | } |
---|
[1677] | 464 | } |
---|
| 465 | |
---|
[1681] | 466 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 467 | } |
---|
| 468 | |
---|
| 469 | CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 470 | { |
---|
[1162] | 471 | CDataPacketPtr packet(new CDataPacket); |
---|
| 472 | packet->date = data[0]->date; |
---|
| 473 | packet->timestamp = data[0]->timestamp; |
---|
| 474 | packet->status = data[0]->status; |
---|
[1681] | 475 | |
---|
| 476 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 477 | |
---|
| 478 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 479 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 480 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 481 | |
---|
[1679] | 482 | packet->field = this->field; |
---|
[1162] | 483 | |
---|
| 484 | if (data[0]->status != CDataPacket::NO_ERROR) |
---|
| 485 | packet->status = data[0]->status; |
---|
| 486 | else if (data[1]->status != CDataPacket::NO_ERROR) |
---|
| 487 | packet->status = data[1]->status; |
---|
| 488 | else |
---|
| 489 | { |
---|
| 490 | packet->status = CDataPacket::NO_ERROR; |
---|
| 491 | packet->data.reference(op(data[0]->data, value, data[1]->data)); |
---|
| 492 | } |
---|
| 493 | return packet; |
---|
| 494 | } |
---|
| 495 | |
---|
| 496 | CFieldFieldScalarArithmeticFilter::CFieldFieldScalarArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value) |
---|
| 497 | : CFilter(gc, 2, this) |
---|
| 498 | , op(operatorExpr.getOpFieldFieldScalar(op)) |
---|
| 499 | , value(value) |
---|
[1680] | 500 | { |
---|
| 501 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 502 | /* Nothing to do */ |
---|
| 503 | }; |
---|
[1162] | 504 | |
---|
[1681] | 505 | std::tuple<int, int, int> CFieldFieldScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 506 | { |
---|
[1681] | 507 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 508 | int unique_filter_id; |
---|
| 509 | |
---|
| 510 | bool firstround; |
---|
| 511 | |
---|
[1679] | 512 | if(building_graph) |
---|
[1681] | 513 | { |
---|
[1680] | 514 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 515 | |
---|
[1681] | 516 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 517 | |
---|
[1681] | 518 | // first round |
---|
| 519 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
| 520 | { |
---|
| 521 | firstround = true; |
---|
| 522 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 523 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 524 | |
---|
| 525 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 526 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 527 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1677] | 528 | |
---|
[1681] | 529 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 530 | |
---|
| 531 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 532 | if(CWorkflowGraph::build_begin) |
---|
| 533 | { |
---|
[1680] | 534 | |
---|
[1681] | 535 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 536 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 537 | |
---|
[1681] | 538 | edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 539 | |
---|
[1681] | 540 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); |
---|
| 541 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 542 | |
---|
[1681] | 543 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 544 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 545 | } |
---|
| 546 | CWorkflowGraph::build_begin = true; |
---|
[1679] | 547 | |
---|
[1681] | 548 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 549 | unique_filter_id = this->filterID; |
---|
| 550 | |
---|
[1679] | 551 | } |
---|
[1681] | 552 | // not first round |
---|
| 553 | else |
---|
| 554 | { |
---|
| 555 | firstround = false; |
---|
| 556 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 557 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 558 | { |
---|
| 559 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 560 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 561 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 562 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 563 | } |
---|
| 564 | if(data[1]->src_filterID != unique_filter_id) |
---|
| 565 | { |
---|
| 566 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 567 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); |
---|
| 568 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 569 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 570 | } |
---|
| 571 | |
---|
| 572 | } |
---|
[1677] | 573 | } |
---|
| 574 | |
---|
[1681] | 575 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 576 | } |
---|
| 577 | |
---|
| 578 | CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 579 | { |
---|
[1162] | 580 | CDataPacketPtr packet(new CDataPacket); |
---|
| 581 | packet->date = data[0]->date; |
---|
| 582 | packet->timestamp = data[0]->timestamp; |
---|
| 583 | packet->status = data[0]->status; |
---|
[1681] | 584 | |
---|
| 585 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 586 | |
---|
| 587 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 588 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 589 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 590 | |
---|
[1679] | 591 | packet->field = this->field; |
---|
[1162] | 592 | |
---|
| 593 | if (data[0]->status != CDataPacket::NO_ERROR) |
---|
| 594 | packet->status = data[0]->status; |
---|
| 595 | else if (data[1]->status != CDataPacket::NO_ERROR) |
---|
| 596 | packet->status = data[1]->status; |
---|
| 597 | else |
---|
| 598 | { |
---|
| 599 | packet->status = CDataPacket::NO_ERROR; |
---|
| 600 | packet->data.reference(op(data[0]->data, data[1]->data, value)); |
---|
| 601 | } |
---|
| 602 | return packet; |
---|
| 603 | } |
---|
| 604 | |
---|
| 605 | |
---|
| 606 | CFieldFieldFieldArithmeticFilter::CFieldFieldFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op) |
---|
| 607 | : CFilter(gc, 3, this) |
---|
| 608 | , op(operatorExpr.getOpFieldFieldField(op)) |
---|
[1680] | 609 | { |
---|
| 610 | expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); |
---|
| 611 | /* Nothing to do */ |
---|
| 612 | }; |
---|
[1162] | 613 | |
---|
[1681] | 614 | std::tuple<int, int, int> CFieldFieldFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) |
---|
[1162] | 615 | { |
---|
[1681] | 616 | bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; |
---|
| 617 | int unique_filter_id; |
---|
| 618 | |
---|
| 619 | bool firstround; |
---|
| 620 | |
---|
[1679] | 621 | if(building_graph) |
---|
[1681] | 622 | { |
---|
[1680] | 623 | CWorkflowGraph::allocNodeEdge(); |
---|
[1677] | 624 | |
---|
[1681] | 625 | size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); |
---|
[1677] | 626 | |
---|
[1681] | 627 | // first round |
---|
| 628 | if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) |
---|
[1679] | 629 | { |
---|
[1681] | 630 | firstround = true; |
---|
| 631 | this->filterID = InvalidableObject::filterIdGenerator++; |
---|
| 632 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 633 | |
---|
| 634 | CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); |
---|
| 635 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); |
---|
| 636 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; |
---|
[1677] | 637 | |
---|
[1681] | 638 | if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); |
---|
| 639 | |
---|
| 640 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; |
---|
| 641 | if(CWorkflowGraph::build_begin) |
---|
| 642 | { |
---|
[1679] | 643 | |
---|
[1681] | 644 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); |
---|
| 645 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 646 | |
---|
[1681] | 647 | edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 648 | |
---|
[1681] | 649 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); |
---|
| 650 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 651 | |
---|
[1681] | 652 | edgeID = InvalidableObject::edgeIdGenerator++; |
---|
[1679] | 653 | |
---|
[1681] | 654 | CWorkflowGraph::addEdge(edgeID, this->filterID, data[2]); |
---|
| 655 | (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; |
---|
[1679] | 656 | |
---|
[1681] | 657 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 658 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 659 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[2]->src_filterID].filter_filled = 0 ; |
---|
| 660 | } |
---|
| 661 | CWorkflowGraph::build_begin = true; |
---|
[1679] | 662 | |
---|
[1681] | 663 | (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; |
---|
| 664 | unique_filter_id = this->filterID; |
---|
| 665 | |
---|
[1679] | 666 | } |
---|
[1681] | 667 | // not first round |
---|
| 668 | else |
---|
| 669 | { |
---|
| 670 | firstround = false; |
---|
| 671 | unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; |
---|
| 672 | if(data[0]->src_filterID != unique_filter_id) |
---|
| 673 | { |
---|
| 674 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 675 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); |
---|
| 676 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; |
---|
| 677 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 678 | } |
---|
| 679 | if(data[1]->src_filterID != unique_filter_id) |
---|
| 680 | { |
---|
| 681 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 682 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); |
---|
| 683 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; |
---|
| 684 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 685 | } |
---|
| 686 | if(data[2]->src_filterID != unique_filter_id) |
---|
| 687 | { |
---|
| 688 | int edgeID = InvalidableObject::edgeIdGenerator++; |
---|
| 689 | CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[2]); |
---|
| 690 | (*CWorkflowGraph::mapFilters_ptr_with_info)[data[2]->src_filterID].filter_filled = 0 ; |
---|
| 691 | (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; |
---|
| 692 | } |
---|
| 693 | |
---|
| 694 | } |
---|
[1677] | 695 | } |
---|
| 696 | |
---|
[1681] | 697 | return std::make_tuple(building_graph, firstround, unique_filter_id); |
---|
| 698 | } |
---|
[1677] | 699 | |
---|
[1681] | 700 | CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) |
---|
| 701 | { |
---|
[1162] | 702 | CDataPacketPtr packet(new CDataPacket); |
---|
| 703 | packet->date = data[0]->date; |
---|
| 704 | packet->timestamp = data[0]->timestamp; |
---|
| 705 | packet->status = data[0]->status; |
---|
[1681] | 706 | |
---|
| 707 | std::tuple<int, int, int> graph = buildGraph(data); |
---|
| 708 | |
---|
| 709 | if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); |
---|
| 710 | if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; |
---|
| 711 | if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; |
---|
| 712 | |
---|
[1679] | 713 | packet->field = this->field; |
---|
[1162] | 714 | |
---|
| 715 | if (data[0]->status != CDataPacket::NO_ERROR) |
---|
| 716 | packet->status = data[0]->status; |
---|
| 717 | else if (data[1]->status != CDataPacket::NO_ERROR) |
---|
| 718 | packet->status = data[1]->status; |
---|
| 719 | else if (data[2]->status != CDataPacket::NO_ERROR) |
---|
| 720 | packet->status = data[2]->status; |
---|
| 721 | else |
---|
| 722 | { |
---|
| 723 | packet->status = CDataPacket::NO_ERROR; |
---|
| 724 | packet->data.reference(op(data[0]->data, data[1]->data, data[2]->data)); |
---|
| 725 | } |
---|
| 726 | return packet; |
---|
| 727 | } |
---|
| 728 | |
---|
| 729 | } // namespace xios |
---|
| 730 | |
---|