"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/config/expression.cpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

expression.cpp  (icinga2-2.11.5):expression.cpp  (icinga2-2.12.0)
skipping to change at line 103 skipping to change at line 103
ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dh int) const ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dh int) const
{ {
return m_Value; return m_Value;
} }
const DebugInfo& DebuggableExpression::GetDebugInfo() const const DebugInfo& DebuggableExpression::GetDebugInfo() const
{ {
return m_DebugInfo; return m_DebugInfo;
} }
VariableExpression::VariableExpression(String variable, std::vector<std::shared_ ptr<Expression> > imports, const DebugInfo& debugInfo) VariableExpression::VariableExpression(String variable, std::vector<Expression:: Ptr> imports, const DebugInfo& debugInfo)
: DebuggableExpression(debugInfo), m_Variable(std::move(variable)), m_Imp orts(std::move(imports)) : DebuggableExpression(debugInfo), m_Variable(std::move(variable)), m_Imp orts(std::move(imports))
{ {
m_Imports.push_back(MakeIndexer(ScopeGlobal, "System")); m_Imports.push_back(MakeIndexer(ScopeGlobal, "System").release());
m_Imports.push_back(std::unique_ptr<Expression>(new IndexerExpression(Mak m_Imports.push_back(new IndexerExpression(MakeIndexer(ScopeGlobal, "Syste
eIndexer(ScopeGlobal, "System"), MakeLiteral("Configuration")))); m"), MakeLiteral("Configuration")));
m_Imports.push_back(MakeIndexer(ScopeGlobal, "Types")); m_Imports.push_back(MakeIndexer(ScopeGlobal, "Types").release());
m_Imports.push_back(MakeIndexer(ScopeGlobal, "Icinga")); m_Imports.push_back(MakeIndexer(ScopeGlobal, "Icinga").release());
} }
ExpressionResult VariableExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d hint) const ExpressionResult VariableExpression::DoEvaluate(ScriptFrame& frame, DebugHint *d hint) const
{ {
Value value; Value value;
if (frame.Locals && frame.Locals->Get(m_Variable, &value)) if (frame.Locals && frame.Locals->Get(m_Variable, &value))
return value; return value;
else if (frame.Self.IsObject() && frame.Locals != frame.Self.Get<Object:: Ptr>() && frame.Self.Get<Object::Ptr>()->GetOwnField(m_Variable, &value)) else if (frame.Self.IsObject() && frame.Locals != frame.Self.Get<Object:: Ptr>() && frame.Self.Get<Object::Ptr>()->GetOwnField(m_Variable, &value))
return value; return value;
skipping to change at line 692 skipping to change at line 692
std::ostringstream msgbuf; std::ostringstream msgbuf;
msgbuf << "Value for constant '" << m_Name << "' was modified. Th is behaviour is deprecated.\n"; msgbuf << "Value for constant '" << m_Name << "' was modified. Th is behaviour is deprecated.\n";
ShowCodeLocation(msgbuf, GetDebugInfo(), false); ShowCodeLocation(msgbuf, GetDebugInfo(), false);
Log(LogWarning, msgbuf.str()); Log(LogWarning, msgbuf.str());
} }
ExpressionResult operandres = m_Operand->Evaluate(frame); ExpressionResult operandres = m_Operand->Evaluate(frame);
CHECK_RESULT(operandres); CHECK_RESULT(operandres);
Value operand = operandres.GetValue(); Value operand = operandres.GetValue();
globals->SetAttribute(m_Name, std::make_shared<ConstEmbeddedNamespaceValu e>(operand)); globals->SetAttribute(m_Name, new ConstEmbeddedNamespaceValue(operand));
return Empty; return Empty;
} }
ExpressionResult ConditionalExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const ExpressionResult ConditionalExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
{ {
ExpressionResult condition = m_Condition->Evaluate(frame, dhint); ExpressionResult condition = m_Condition->Evaluate(frame, dhint);
CHECK_RESULT(condition); CHECK_RESULT(condition);
if (condition.GetValue().ToBool()) if (condition.GetValue().ToBool())
 End of changes. 3 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)