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/include/modeling/Rack.h | |
Initial code commit with organized dependencies
Diffstat (limited to 'Simulator/include/modeling/Rack.h')
| -rw-r--r-- | Simulator/include/modeling/Rack.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Simulator/include/modeling/Rack.h b/Simulator/include/modeling/Rack.h new file mode 100644 index 00000000..7e5638ef --- /dev/null +++ b/Simulator/include/modeling/Rack.h @@ -0,0 +1,33 @@ +#pragma once +#include "modeling/Entity.h" +#include "modeling/machine/Machine.h" + +#include <unordered_map> + +namespace Modeling +{ + /* + The Rack class models a physical rack. It holds a vector of machines. + */ + class Rack : public Entity + { + public: + /* + Initializes the rack with the given machines. + */ + Rack(int id, std::unordered_map<uint32_t, Machine> machines); + + /* + Returns all machines in this rack. + */ + std::unordered_map<uint32_t, Machine>& getMachines(); + + /* + Returns the machine at the given slot. + */ + Machine& getMachineAtSlot(int slot); + + private: + std::unordered_map<uint32_t, Machine> machines; + }; +} |
