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

Method CalculateConfigHash

lib/db_ido/dbobject.cpp:72–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72String DbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) const
73{
74 Dictionary::Ptr configFieldsDup = configFields->ShallowClone();
75
76 {
77 ObjectLock olock(configFieldsDup);
78
79 for (const Dictionary::Pair& kv : configFieldsDup) {
80 if (kv.second.IsObjectType<ConfigObject>()) {
81 ConfigObject::Ptr obj = kv.second;
82 configFieldsDup->Set(kv.first, obj->GetName());
83 }
84 }
85 }
86
87 Array::Ptr data = new Array();
88 data->Add(configFieldsDup);
89
90 CustomVarObject::Ptr custom_var_object = dynamic_pointer_cast<CustomVarObject>(GetObject());
91
92 if (custom_var_object)
93 data->Add(custom_var_object->GetVars());
94
95 return HashValue(data);
96}
97
98String DbObject::HashValue(const Value& value)
99{

Callers 2

VersionChangedHandlerMethod · 0.45
UpdateObjectMethod · 0.45

Calls 4

ShallowCloneMethod · 0.45
SetMethod · 0.45
GetNameMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected