Build fix for Windows

refs #9777
This commit is contained in:
Gunnar Beutner 2015-10-29 08:06:03 +01:00
parent 46e892cc60
commit 0013d26425
6 changed files with 65 additions and 67 deletions

View File

@ -133,7 +133,7 @@ void Comment::Stop(bool runtimeRemoved)
Checkable::Ptr Comment::GetCheckable(void) const Checkable::Ptr Comment::GetCheckable(void) const
{ {
return m_Checkable; return static_pointer_cast<Checkable>(m_Checkable);
} }
bool Comment::IsExpired(void) const bool Comment::IsExpired(void) const

View File

@ -22,13 +22,12 @@
#include "icinga/i2-icinga.hpp" #include "icinga/i2-icinga.hpp"
#include "icinga/comment.thpp" #include "icinga/comment.thpp"
#include "icinga/checkable.thpp"
#include "remote/messageorigin.hpp" #include "remote/messageorigin.hpp"
namespace icinga namespace icinga
{ {
class Checkable;
/** /**
* A comment. * A comment.
* *
@ -65,7 +64,7 @@ protected:
virtual void Stop(bool runtimeRemoved) override; virtual void Stop(bool runtimeRemoved) override;
private: private:
intrusive_ptr<Checkable> m_Checkable; ObjectImpl<Checkable>::Ptr m_Checkable;
static void CommentsExpireTimerHandler(void); static void CommentsExpireTimerHandler(void);
}; };

View File

@ -147,7 +147,7 @@ void Downtime::Stop(bool runtimeRemoved)
Checkable::Ptr Downtime::GetCheckable(void) const Checkable::Ptr Downtime::GetCheckable(void) const
{ {
return m_Checkable; return static_pointer_cast<Checkable>(m_Checkable);
} }
bool Downtime::IsActive(void) const bool Downtime::IsActive(void) const

View File

@ -22,13 +22,12 @@
#include "icinga/i2-icinga.hpp" #include "icinga/i2-icinga.hpp"
#include "icinga/downtime.thpp" #include "icinga/downtime.thpp"
#include "icinga/checkable.thpp"
#include "remote/messageorigin.hpp" #include "remote/messageorigin.hpp"
namespace icinga namespace icinga
{ {
class Checkable;
/** /**
* A downtime. * A downtime.
* *
@ -75,7 +74,7 @@ protected:
virtual void ValidateEndTime(double value, const ValidationUtils& utils) override; virtual void ValidateEndTime(double value, const ValidationUtils& utils) override;
private: private:
intrusive_ptr<Checkable> m_Checkable; ObjectImpl<Checkable>::Ptr m_Checkable;
static void DowntimesExpireTimerHandler(void); static void DowntimesExpireTimerHandler(void);
}; };

View File

@ -119,7 +119,7 @@ void Notification::OnAllConfigLoaded(void)
if (!m_Checkable) if (!m_Checkable)
BOOST_THROW_EXCEPTION(ScriptError("Notification object refers to a host/service which doesn't exist.", GetDebugInfo())); BOOST_THROW_EXCEPTION(ScriptError("Notification object refers to a host/service which doesn't exist.", GetDebugInfo()));
m_Checkable->RegisterNotification(this); GetCheckable()->RegisterNotification(this);
} }
void Notification::Start(bool runtimeCreated) void Notification::Start(bool runtimeCreated)
@ -144,7 +144,7 @@ void Notification::Stop(bool runtimeRemoved)
Checkable::Ptr Notification::GetCheckable(void) const Checkable::Ptr Notification::GetCheckable(void) const
{ {
return m_Checkable; return static_pointer_cast<Checkable>(m_Checkable);
} }
NotificationCommand::Ptr Notification::GetCommand(void) const NotificationCommand::Ptr Notification::GetCommand(void) const

View File

@ -22,6 +22,7 @@
#include "icinga/i2-icinga.hpp" #include "icinga/i2-icinga.hpp"
#include "icinga/notification.thpp" #include "icinga/notification.thpp"
#include "icinga/checkable.thpp"
#include "icinga/user.hpp" #include "icinga/user.hpp"
#include "icinga/usergroup.hpp" #include "icinga/usergroup.hpp"
#include "icinga/timeperiod.hpp" #include "icinga/timeperiod.hpp"
@ -66,7 +67,6 @@ enum NotificationType
}; };
class NotificationCommand; class NotificationCommand;
class Checkable;
class ApplyRule; class ApplyRule;
struct ScriptFrame; struct ScriptFrame;
class Host; class Host;
@ -122,7 +122,7 @@ protected:
virtual void Stop(bool runtimeRemoved) override; virtual void Stop(bool runtimeRemoved) override;
private: private:
intrusive_ptr<Checkable> m_Checkable; ObjectImpl<Checkable>::Ptr m_Checkable;
void ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, bool force, const String& author = "", const String& text = ""); void ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, bool force, const String& author = "", const String& text = "");