MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / InsertFunction

Method InsertFunction

eval/public/activation.cc:29–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29absl::Status Activation::InsertFunction(std::unique_ptr<CelFunction> function) {
30 auto& overloads = function_map_[function->descriptor().name()];
31 for (const auto& overload : overloads) {
32 if (overload->descriptor().ShapeMatches(function->descriptor())) {
33 return absl::InvalidArgumentError(
34 "Function with same shape already defined in activation");
35 }
36 }
37 overloads.emplace_back(std::move(function));
38 return absl::OkStatus();
39}
40
41std::vector<const CelFunction*> Activation::FindFunctionOverloads(
42 absl::string_view name) const {

Callers 7

TESTFunction · 0.45
TESTFunction · 0.45
SetupActivationMethod · 0.45
ASSERT_OK_AND_ASSIGNFunction · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45

Calls 2

nameMethod · 0.45
ShapeMatchesMethod · 0.45

Tested by 7

TESTFunction · 0.36
TESTFunction · 0.36
SetupActivationMethod · 0.36
ASSERT_OK_AND_ASSIGNFunction · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36