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