service: add IsHostCheck helper

This commit is contained in:
Michael Friedrich 2013-07-09 16:59:31 +02:00
parent 0f56513087
commit 3023686042
3 changed files with 16 additions and 0 deletions

View File

@ -314,6 +314,7 @@ int Host::GetTotalServices(void) const
{
return GetServices().size();
}
void Host::InvalidateServicesCache(void)
{
{

View File

@ -200,6 +200,19 @@ String Service::GetShortName(void) const
return m_ShortName;
}
bool Service::IsHostCheck(void) const
{
ASSERT(!OwnsLock());
Service::Ptr hc = GetHost()->GetHostCheckService();
if (!hc)
return false;
return (hc->GetName() == GetName());
}
bool Service::IsReachable(void) const
{
ASSERT(!OwnsLock());

View File

@ -122,6 +122,8 @@ public:
std::set<Host::Ptr> GetParentHosts(void) const;
std::set<Service::Ptr> GetParentServices(void) const;
bool IsHostCheck(void) const;
bool IsVolatile(void) const;
bool IsReachable(void) const;