place netsim in static library
This commit is contained in:
parent
aa458dadd6
commit
8f840ff1fe
10 changed files with 17 additions and 10 deletions
20
netsim/include/Device.hpp
Normal file
20
netsim/include/Device.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
class Device {
|
||||
public:
|
||||
friend std::ostream& operator<<(std::ostream& os, const Device& device);
|
||||
|
||||
public:
|
||||
Device(const std::string& macAddress);
|
||||
static std::shared_ptr<Device> create(const std::string& macAddress);
|
||||
|
||||
private:
|
||||
void parseAndSetMac(const std::string& macAddress);
|
||||
|
||||
private:
|
||||
uint8_t macAddress[6];
|
||||
};
|
4
netsim/include/Netsim.hpp
Normal file
4
netsim/include/Netsim.hpp
Normal file
|
@ -0,0 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#include "Network.hpp"
|
||||
#include "Device.hpp"
|
21
netsim/include/Network.hpp
Normal file
21
netsim/include/Network.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Device.hpp"
|
||||
|
||||
class Network {
|
||||
public:
|
||||
friend std::ostream& operator<<(std::ostream& os, const Network& network);
|
||||
|
||||
public:
|
||||
Network(const std::string& name);
|
||||
|
||||
void addDevice(std::shared_ptr<Device> device);
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<Device>> devices;
|
||||
std::string name;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue