/* triggered in ProcessCheckResult(), requires UpdateNextCheck() to be called before */
ConfigObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
CustomVarObject::OnVarsChanged.connect(boost::bind(&DbObject::VarsChangedHandler, _1));
+
+ /* triggered on create, update and delete objects */
+ ConfigObject::OnVersionChanged.connect(boost::bind(&DbObject::VersionChangedHandler, _1));
}
void DbObject::SetObject(const ConfigObject::Ptr& object)
dbobj->SendVarsStatusUpdate();
}
+void DbObject::VersionChangedHandler(const ConfigObject::Ptr& object)
+{
+ DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);
+
+ if (dbobj) {
+ dbobj->SendConfigUpdate();
+ dbobj->SendStatusUpdate();
+ }
+}
+
boost::mutex& DbObject::GetStaticMutex(void)
{
static boost::mutex mutex;
static void StateChangedHandler(const ConfigObject::Ptr& object);
static void VarsChangedHandler(const CustomVarObject::Ptr& object);
+ static void VersionChangedHandler(const ConfigObject::Ptr& object);
+
static boost::mutex& GetStaticMutex(void);
friend class DbType;