diff options
| author | MDBijman <matthijs@bijman.org> | 2017-01-24 12:15:26 +0100 |
|---|---|---|
| committer | MDBijman <matthijs@bijman.org> | 2017-01-24 12:15:26 +0100 |
| commit | 070ce923574dcc57435cb3fb2dfe86b6a38cd249 (patch) | |
| tree | ffd69a842ac4ad22aaf7161f923b9f0b47c7147a /Simulator/src/modeling/Rack.cpp | |
Initial code commit with organized dependencies
Diffstat (limited to 'Simulator/src/modeling/Rack.cpp')
| -rw-r--r-- | Simulator/src/modeling/Rack.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Simulator/src/modeling/Rack.cpp b/Simulator/src/modeling/Rack.cpp new file mode 100644 index 00000000..2b330abd --- /dev/null +++ b/Simulator/src/modeling/Rack.cpp @@ -0,0 +1,21 @@ +#include "modeling/Rack.h" + +#include <assert.h> +#include <iterator> + +namespace Modeling +{ + Rack::Rack(int id, std::unordered_map<uint32_t, Machine> machines) : Entity(id), machines(machines) {} + + std::unordered_map<uint32_t, Machine>& Rack::getMachines() + { + return machines; + } + + Machine& Rack::getMachineAtSlot(int slot) + { + assert(machines.find(slot) != machines.end()); + + return machines.at(slot); + } +} |
