mirror of https://github.com/Icinga/icinga2.git
parent
ae1dcf6258
commit
ff12522a62
|
@ -31,6 +31,7 @@
|
|||
#include "base/initialize.hpp"
|
||||
#include "base/scriptvariable.hpp"
|
||||
#include "base/workqueue.hpp"
|
||||
#include "base/context.hpp"
|
||||
#include <fstream>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/exception/errinfo_api_function.hpp>
|
||||
|
@ -125,6 +126,8 @@ void DynamicObject::Start(void)
|
|||
|
||||
void DynamicObject::Activate(void)
|
||||
{
|
||||
CONTEXT("Activating object '" + GetName() + "' of type '" + GetType()->GetName() + "'");
|
||||
|
||||
ASSERT(!OwnsLock());
|
||||
|
||||
Start();
|
||||
|
@ -152,6 +155,8 @@ void DynamicObject::Stop(void)
|
|||
|
||||
void DynamicObject::Deactivate(void)
|
||||
{
|
||||
CONTEXT("Deactivating object '" + GetName() + "' of type '" + GetType()->GetName() + "'");
|
||||
|
||||
ASSERT(!OwnsLock());
|
||||
|
||||
SetAuthority(false);
|
||||
|
|
|
@ -131,6 +131,12 @@ bool Value::operator!=(const String& rhs) const
|
|||
|
||||
bool Value::operator==(const Value& rhs) const
|
||||
{
|
||||
if ((IsNumber() || IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(IsEmpty() && rhs.IsEmpty()))
|
||||
return static_cast<double>(*this) == static_cast<double>(rhs);
|
||||
|
||||
if ((IsString() || IsEmpty()) && (rhs.IsString() || rhs.IsEmpty()) && !(IsEmpty() && rhs.IsEmpty()))
|
||||
return static_cast<String>(*this) == static_cast<String>(rhs);
|
||||
|
||||
if (IsEmpty() != rhs.IsEmpty())
|
||||
return false;
|
||||
|
||||
|
@ -162,12 +168,6 @@ bool Value::operator==(const Value& rhs) const
|
|||
return static_cast<Object::Ptr>(*this) == static_cast<Object::Ptr>(rhs);
|
||||
}
|
||||
|
||||
if ((IsNumber() || IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(IsEmpty() && rhs.IsEmpty()))
|
||||
return static_cast<double>(*this) == static_cast<double>(rhs);
|
||||
|
||||
if ((IsString() || IsEmpty()) && (rhs.IsString() || rhs.IsEmpty()) && !(IsEmpty() && rhs.IsEmpty()))
|
||||
return static_cast<String>(*this) == static_cast<String>(rhs);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue