added networking components, hosts are next
This commit is contained in:
39
src/core/node.h
Normal file
39
src/core/node.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user