diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-07-09 23:48:06 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-07-09 23:48:06 +0200 |
| commit | c94d0c347fdbd8acc774df4ac17617a3f63e4507 (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /Simulator/include/simulation/history/SimulationHistory.h | |
| parent | bc4c41e21a64b444bdbab3b6d1d407fd5d919419 (diff) | |
Delete old codebase
This change removes version 1 of the OpenDC simulator codebase as it
will be replaced by a complete rewrite in the Kotlin language.
Diffstat (limited to 'Simulator/include/simulation/history/SimulationHistory.h')
| -rw-r--r-- | Simulator/include/simulation/history/SimulationHistory.h | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/Simulator/include/simulation/history/SimulationHistory.h b/Simulator/include/simulation/history/SimulationHistory.h deleted file mode 100644 index f43968b7..00000000 --- a/Simulator/include/simulation/history/SimulationHistory.h +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once -#include "History.h" -#include "WorkloadSnapshot.h" -#include "MachineSnapshot.h" - -#include <unordered_map> - -namespace Simulation -{ - using WorkloadHistory = History<WorkloadSnapshot>; - using MachineHistory = History<MachineSnapshot>; - using HistoryRef = std::tuple<std::reference_wrapper<WorkloadHistory>, std::reference_wrapper<MachineHistory>>; - - class SimulationHistory - { - public: - /* - Adds the workload snapshot at the given tick. - */ - void addSnapshot(uint32_t tick, WorkloadSnapshot snapshots) - { - workloadHistory.addSnapshotAtTick(tick, snapshots); - } - - /* - Adds the machine snapshot at the given tick. - */ - void addSnapshot(uint32_t tick, MachineSnapshot snapshots) - { - machineHistory.addSnapshotAtTick(tick, snapshots); - } - - /* - Returns the equal_range of the workload snapshots at the given tick. - */ - auto getWorkloadSnapshot(uint32_t tick) - { - return workloadHistory.snapshotsAtTick(tick); - } - - /* - Returns the equal_range of the machine snapshots at the given tick. - */ - auto getMachineSnapshot(uint32_t tick) - { - return machineHistory.snapshotsAtTick(tick); - } - - /* - Returns a const tuple ref of the entire cached history of machines and workloads. - */ - const HistoryRef getHistory() - { - return std::make_tuple( - std::ref(workloadHistory), - std::ref(machineHistory) - ); - } - - /* - Clears the cache of history. - */ - void clearHistory() - { - workloadHistory.clear(); - machineHistory.clear(); - } - - /* - Returns the number of snapshots that are in the history cache. - */ - size_t historySize() - { - return workloadHistory.size(); - } - - private: - WorkloadHistory workloadHistory; - MachineHistory machineHistory; - }; -}
\ No newline at end of file |
