Moved OnCheckResultReceived signal to the Service class.

This commit is contained in:
Gunnar Beutner 2012-07-26 12:28:29 +02:00
parent 61e381befc
commit a1a3cb7d0f
5 changed files with 6 additions and 4 deletions

View File

@ -22,7 +22,6 @@
using namespace icinga;
RingBuffer CIB::m_TaskStatistics(15 * 60);
boost::signal<void (const CheckResultMessage&)> CIB::OnCheckResultReceived;
void CIB::UpdateTaskStatistics(long tv, int num)
{

View File

@ -29,8 +29,6 @@ public:
static void UpdateTaskStatistics(long tv, int num);
static int GetTaskStatistics(long timespan);
static boost::signal<void (const CheckResultMessage&)> OnCheckResultReceived;
private:
static RingBuffer m_TaskStatistics;
};

View File

@ -21,6 +21,8 @@
using namespace icinga;
boost::signal<void (Service, const CheckResultMessage&)> Service::OnCheckResultReceived;
Service::Service(const ConfigObject::Ptr& configObject)
: ConfigObjectAdapter(configObject)
{

View File

@ -39,6 +39,7 @@ enum ServiceStateType
};
class CheckResult;
class CheckResultMessage;
class ServiceStatusMessage;
class I2_CIB_API Service : public ConfigObjectAdapter
@ -103,6 +104,8 @@ public:
static string StateTypeToString(ServiceStateType state);
static Dictionary::Ptr ResolveDependencies(Host host, const Dictionary::Ptr& dependencies);
static boost::signal<void (Service service, const CheckResultMessage&)> OnCheckResultReceived;
};
}

View File

@ -93,7 +93,7 @@ void CIBSyncComponent::CheckResultRequestHandler(const Endpoint::Ptr& sender, co
if (!params.GetCheckResult(&cr))
return;
CIB::OnCheckResultReceived(params);
Service::OnCheckResultReceived(service, params);
service.ApplyCheckResult(cr);
time_t now = Utility::GetTime();