From 070ce923574dcc57435cb3fb2dfe86b6a38cd249 Mon Sep 17 00:00:00 2001 From: MDBijman Date: Tue, 24 Jan 2017 12:15:26 +0100 Subject: Initial code commit with organized dependencies --- Simulator/include/modeling/Datacenter.h | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Simulator/include/modeling/Datacenter.h (limited to 'Simulator/include/modeling/Datacenter.h') diff --git a/Simulator/include/modeling/Datacenter.h b/Simulator/include/modeling/Datacenter.h new file mode 100644 index 00000000..a9558f0a --- /dev/null +++ b/Simulator/include/modeling/Datacenter.h @@ -0,0 +1,40 @@ +#pragma once +#include "modeling/Room.h" +#include "simulation/schedulers/Scheduler.h" +#include "modeling/TypeIndex.h" + +#include + +namespace Modeling +{ + /* + The Datacenter class models a datacenter with rooms/entities. + */ + template + class Datacenter + { + public: + /* + Returns a reference to the vector of rooms in this datacenter. + */ + template + std::vector& getRoomsOfType() + { + return std::get::value>(rooms); + } + + /* + Adds a room to this datacenter. + */ + template + void addRoomOfType(RoomType& room) + { + std::get::value>(rooms).push_back(std::move(room)); + } + + + private: + // A vector of rooms that are part of this datacenter. + std::tuple...> rooms; + }; +} -- cgit v1.2.3