40 lines
778 B
C++
40 lines
778 B
C++
#ifndef CORE_NODE_H
|
|
#define CORE_NODE_H
|
|
|
|
#include <cstdint>
|
|
|
|
#include "core/simulator.h"
|
|
#include "core/time.h"
|
|
#include "core/types.h"
|
|
|
|
namespace dofs {
|
|
|
|
class Node {
|
|
public:
|
|
Node(Simulator *const sim, NodeId id, NodeType type) noexcept;
|
|
virtual ~Node() = default;
|
|
|
|
NodeId id() const noexcept;
|
|
NodeStatus status() const noexcept;
|
|
NodeType type() const noexcept;
|
|
|
|
void set_status(NodeStatus s) noexcept;
|
|
|
|
void boot(Time boottime_ns);
|
|
void reboot(Time boottime_ns);
|
|
|
|
Node(const Node &) = delete;
|
|
Node &operator=(const Node &) = delete;
|
|
|
|
protected:
|
|
Simulator *const _sim;
|
|
|
|
NodeId _id;
|
|
NodeStatus _status;
|
|
NodeType _type;
|
|
};
|
|
|
|
} // namespace dofs
|
|
|
|
#endif // CORE_NODE_H
|