MCPcopy Create free account
hub / github.com/Icinga/icinga2 / Get

Method Get

lib/base/scriptglobal.cpp:22–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20Namespace::Ptr ScriptGlobal::m_Globals = new Namespace();
21
22Value ScriptGlobal::Get(const String& name, const Value *defaultValue)
23{
24 Value result;
25
26 if (!m_Globals->Get(name, &result)) {
27 if (defaultValue)
28 return *defaultValue;
29
30 BOOST_THROW_EXCEPTION(std::invalid_argument("Tried to access undefined script variable '" + name + "'"));
31 }
32
33 return result;
34}
35
36void ScriptGlobal::Set(const String& name, const Value& value)
37{

Callers 1

SetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected