MCPcopy Create free account
hub / github.com/apache/trafficserver / load

Method load

plugins/experimental/txn_box/plugin/src/Modifier.cc:44–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44Rv<Modifier::Handle>
45Modifier::load(Config &cfg, YAML::Node const &node, ActiveType ex_type)
46{
47 if (!node.IsMap()) {
48 return Errata(S_ERROR, R"(Modifier at {} is not an object as required.)", node.Mark());
49 }
50
51 for (auto const &[key_node, value_node] : node) {
52 TextView key{key_node.Scalar()};
53 auto &&[arg, arg_errata]{parse_arg(key)};
54 if (!arg_errata.is_ok()) {
55 return std::move(arg_errata);
56 }
57 // See if @a key is in the factory.
58 if (auto spot{_factory.find(key)}; spot != _factory.end()) {
59 auto &&[handle, errata]{spot->second(cfg, node, key, arg, value_node)};
60
61 if (!errata.is_ok()) {
62 return std::move(errata);
63 }
64 if (!handle->is_valid_for(ex_type)) {
65 return Errata(S_ERROR, R"(Modifier "{}" at {} cannot accept a feature of type "{}".)", key, node.Mark(), ex_type);
66 }
67
68 return std::move(handle);
69 }
70 }
71 return Errata(S_ERROR, R"(No valid modifier key in object at {}.)", node.Mark());
72}
73
74swoc::Rv<Feature>
75Modifier::operator()(Context &, feature_type_for<NIL>)

Callers

nothing calls this directly

Calls 15

ErrataClass · 0.85
parse_argFunction · 0.85
svtouFunction · 0.85
MaskForFunction · 0.85
ScalarMethod · 0.80
take_prefix_atMethod · 0.80
parse_exprMethod · 0.80
capture_countMethod · 0.80
feature_scopeMethod · 0.80
can_satisfyMethod · 0.80
tuple_typesMethod · 0.80
is_nullMethod · 0.80

Tested by

no test coverage detected