31 lines
850 B
C++
31 lines
850 B
C++
#ifndef PROCESS_LIBPROCESS_EXT_INCLUDE_NODE_CHECKER_HPP
|
|
#define PROCESS_LIBPROCESS_EXT_INCLUDE_NODE_CHECKER_HPP
|
|
|
|
#include <process/watchdog.hpp>
|
|
|
|
#include "node_statistic.hpp"
|
|
#include <memory>
|
|
|
|
namespace process::controller {
|
|
class NodeOSInterface;
|
|
|
|
class NodeCheckerCallback {
|
|
public:
|
|
virtual void on_node_statistic_changed(const ::process::controller::NodeStatistic& ps) = 0;
|
|
};
|
|
|
|
class NodeChecker : public WatchdogChecker<NodeCheckerCallback> {
|
|
public:
|
|
//TODO default OSInterface in constructor, here should be nullptr if there are include problems/forward declare?
|
|
NodeChecker(std::shared_ptr<NodeCheckerCallback> cb,
|
|
std::shared_ptr<NodeOSInterface> interface = nullptr);
|
|
|
|
void check() override;
|
|
|
|
protected:
|
|
std::shared_ptr<NodeOSInterface> m_interface;
|
|
::process::controller::NodeStatistic m_stat;
|
|
};
|
|
}
|
|
|
|
#endif
|