Initial version
This commit is contained in:
commit
04b878f078
28 changed files with 1771 additions and 0 deletions
31
example/include/process/node_checker.hpp
Normal file
31
example/include/process/node_checker.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue