ppap4lmp  0.7.2
filter.cpp
Go to the documentation of this file.
1 
9 #include "filter.h"
10 #include "../utils/message.h"
11 
12 namespace ut = utils;
13 
14 /* ------------------------------------------------------------------ */
15 
17  const ElPtr &elem,
18  Json &data)
19 {
20  if (data.is_array())
21  {
22  compute_common(elem, data);
23  }
24  else
25  {
26  ut::warning("Non-array data will not be filtered");
27  }
28 }
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
Definition: element.h:378
This file has a definition of Filter class, which is a subclass of Updater class. ...
nlohmann::json Json
Json is an alias for nlohmann::json.
Definition: json.h:22
virtual void compute_body(const ElPtr &elem, Json &data) override
Filter elements from array Element::data given as a mutable reference.
Definition: filter.cpp:16
void warning(const Str &msg)
Waning with a message.
Definition: message.cpp:40
Namespace for utility functions.
Definition: join.h:14
virtual void compute_common(const ElPtr &elem, Json &data)
Common part of compute_body.
Definition: updater.cpp:47