mirror of https://github.com/Icinga/icinga2.git
parent
601e10cb46
commit
af951819bc
|
@ -34,8 +34,7 @@ namespace icinga
|
|||
class DynamicType;
|
||||
|
||||
/**
|
||||
* A dynamic object that can be instantiated from the configuration file
|
||||
* and that supports attribute replication to remote application instances.
|
||||
* A dynamic object that can be instantiated from the configuration file.
|
||||
*
|
||||
* @ingroup base
|
||||
*/
|
||||
|
|
|
@ -255,6 +255,6 @@ void Checkable::SetModifiedAttributes(int flags, const MessageOrigin& origin)
|
|||
|
||||
if ((flags & ModAttrCustomVariable) == 0) {
|
||||
SetOverrideVars(Empty);
|
||||
OnVarsChanged(GetSelf());
|
||||
OnVarsChanged(GetSelf(), origin);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,6 @@ void Command::SetModifiedAttributes(int flags, const MessageOrigin& origin)
|
|||
{
|
||||
if ((flags & ModAttrCustomVariable) == 0) {
|
||||
SetOverrideVars(Empty);
|
||||
OnVarsChanged(GetSelf());
|
||||
OnVarsChanged(GetSelf(), origin);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ using namespace icinga;
|
|||
|
||||
REGISTER_TYPE(CustomVarObject);
|
||||
|
||||
boost::signals2::signal<void (const CustomVarObject::Ptr&)> CustomVarObject::OnVarsChanged;
|
||||
boost::signals2::signal<void (const CustomVarObject::Ptr&, const MessageOrigin&)> CustomVarObject::OnVarsChanged;
|
||||
|
||||
Dictionary::Ptr CustomVarObject::GetVars(void) const
|
||||
{
|
||||
|
@ -34,13 +34,13 @@ Dictionary::Ptr CustomVarObject::GetVars(void) const
|
|||
return GetVarsRaw();
|
||||
}
|
||||
|
||||
void CustomVarObject::SetVars(const Dictionary::Ptr& vars)
|
||||
void CustomVarObject::SetVars(const Dictionary::Ptr& vars, const MessageOrigin& origin)
|
||||
{
|
||||
SetOverrideVars(vars);
|
||||
|
||||
Log(LogDebug, "icinga", "Setting vars for object '" + GetName() + "'");
|
||||
|
||||
OnVarsChanged(GetSelf());
|
||||
OnVarsChanged(GetSelf(), origin);
|
||||
}
|
||||
|
||||
int CustomVarObject::GetModifiedAttributes(void) const
|
||||
|
@ -54,7 +54,7 @@ void CustomVarObject::SetModifiedAttributes(int, const MessageOrigin&)
|
|||
/* does nothing by default */
|
||||
}
|
||||
|
||||
bool CustomVarObject::IsVarOverridden(const String& name)
|
||||
bool CustomVarObject::IsVarOverridden(const String& name) const
|
||||
{
|
||||
Dictionary::Ptr vars_override = GetOverrideVars();
|
||||
|
||||
|
|
|
@ -49,25 +49,24 @@ enum ModifiedAttributeType
|
|||
};
|
||||
|
||||
/**
|
||||
* A dynamic object that can be instantiated from the configuration file
|
||||
* and that supports attribute replication to remote application instances.
|
||||
* An object with custom variable attribute.
|
||||
*
|
||||
* @ingroup base
|
||||
* @ingroup icinga
|
||||
*/
|
||||
class I2_BASE_API CustomVarObject : public ObjectImpl<CustomVarObject>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CustomVarObject);
|
||||
|
||||
static boost::signals2::signal<void (const CustomVarObject::Ptr&)> OnVarsChanged;
|
||||
static boost::signals2::signal<void (const CustomVarObject::Ptr&, const MessageOrigin&)> OnVarsChanged;
|
||||
|
||||
Dictionary::Ptr GetVars(void) const;
|
||||
void SetVars(const Dictionary::Ptr& vars);
|
||||
void SetVars(const Dictionary::Ptr& vars, const MessageOrigin& origin = MessageOrigin());
|
||||
|
||||
virtual int GetModifiedAttributes(void) const;
|
||||
virtual void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin());
|
||||
|
||||
bool IsVarOverridden(const String& name);
|
||||
bool IsVarOverridden(const String& name) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -121,6 +121,6 @@ void User::SetModifiedAttributes(int flags, const MessageOrigin& origin)
|
|||
{
|
||||
if ((flags & ModAttrCustomVariable) == 0) {
|
||||
SetOverrideVars(Empty);
|
||||
OnVarsChanged(GetSelf());
|
||||
OnVarsChanged(GetSelf(), origin);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue