icinga2/icinga/nagioschecktask.h

38 lines
795 B
C
Raw Normal View History

#ifndef NAGIOSCHECKTASK_H
#define NAGIOSCHECKTASK_H
namespace icinga
{
2012-06-19 12:23:52 +02:00
class I2_ICINGA_API NagiosCheckTask : public CheckTask, public ThreadPoolTask
{
public:
2012-06-19 09:38:20 +02:00
typedef shared_ptr<NagiosCheckTask> Ptr;
typedef weak_ptr<NagiosCheckTask> WeakPtr;
NagiosCheckTask(const Service& service);
virtual void Enqueue(void);
2012-06-17 20:35:56 +02:00
virtual CheckResult GetResult(void);
static CheckTask::Ptr CreateTask(const Service& service);
static void FlushQueue(void);
2012-06-19 09:38:20 +02:00
static void GetFinishedTasks(vector<CheckTask::Ptr>& tasks);
private:
string m_Command;
2012-06-19 09:38:20 +02:00
CheckResult m_Result;
2012-06-17 20:35:56 +02:00
2012-06-19 12:23:52 +02:00
static list<ThreadPoolTask::Ptr> m_QueuedTasks;
2012-06-19 09:38:20 +02:00
static boost::mutex m_FinishedTasksMutex;
static vector<CheckTask::Ptr> m_FinishedTasks;
2012-06-19 12:23:52 +02:00
virtual void Execute(void);
void RunCheck(void);
};
}
#endif /* NAGIOSCHECKTASK_H */