3#include <SimoxUtility/algorithm/string.h>
8 const std::map<std::string, Normalization>& normalization) :
9 whitelist(whitelist), normalization(normalization)
14 WhitelistFilter::pathInWhitelist(
const aron::Path& p)
const
16 for (
const auto& w : whitelist)
18 if (simox::alg::starts_with(p.
toString(), w))
30 for (
const auto& el :
aron->getElements())
37 l->addElement(v.data);
41 if (l->getElements().size() || pathInWhitelist(
aron->getPath()))
51 for (
const auto& [k, el] :
aron->getElements())
58 l->addElement(k, v.data);
62 if (l->getElements().size() || pathInWhitelist(
aron->getPath()))
71 if (pathInWhitelist(
aron->getPath()))
80 if (pathInWhitelist(
aron->getPath()))
82 auto e =
aron->clone();
83 int v = checkForNormalization(
aron->getPath(), e->getValue());
92 if (pathInWhitelist(
aron->getPath()))
94 auto e =
aron->clone();
95 long v = checkForNormalization(
aron->getPath(), e->getValue());
104 if (pathInWhitelist(
aron->getPath()))
106 auto e =
aron->clone();
107 float v = checkForNormalization(
aron->getPath(), e->getValue());
116 if (pathInWhitelist(
aron->getPath()))
118 auto e =
aron->clone();
119 double v = checkForNormalization(
aron->getPath(), e->getValue());
128 if (pathInWhitelist(
aron->getPath()))
130 auto e =
aron->clone();
131 bool v = checkForNormalization(
aron->getPath(), e->getValue());
140 if (pathInWhitelist(
aron->getPath()))
std::string toString() const
void visitAronVariant(const data::DictPtr &) override
aron::data::VariantPtr data
WhitelistFilter(const std::vector< std::string > &whitelist, const std::map< std::string, Normalization > &normalization={})
std::shared_ptr< Dict > DictPtr
std::shared_ptr< List > ListPtr
std::shared_ptr< Bool > BoolPtr
std::shared_ptr< Float > FloatPtr
std::shared_ptr< NDArray > NDArrayPtr
std::shared_ptr< Long > LongPtr
std::shared_ptr< Int > IntPtr
void visit(VisitorImplementation &v, typename VisitorImplementation::Input &o)
std::shared_ptr< Double > DoublePtr
std::shared_ptr< String > StringPtr
aron::data::ListPtr make_list(_Args &&... args)
aron::data::DictPtr make_dict(_Args &&... args)