From 1482c7dbe3dd7de66ccffee9596dd42e12698b04 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 16 Dec 2022 01:40:09 +0100 Subject: Replaced standard output with simplistic EventLog container and scene --- stats/include/kurator/stats/BaseLog.h | 28 ++++++++++++++++++++++++++ stats/include/kurator/stats/BaseLog.inl.h | 33 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 stats/include/kurator/stats/BaseLog.h create mode 100644 stats/include/kurator/stats/BaseLog.inl.h (limited to 'stats') diff --git a/stats/include/kurator/stats/BaseLog.h b/stats/include/kurator/stats/BaseLog.h new file mode 100644 index 0000000..142b2f2 --- /dev/null +++ b/stats/include/kurator/stats/BaseLog.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include + + +namespace kurator +{ +namespace stats +{ + + +template +class BaseLog +{ +public: + template void push_back(Event event); + template void for_each(Visitor visitor) const; +private: + std::vector> events; +}; + + +} // namespace stats +} // namespace kurator + + +#include "BaseLog.inl.h" diff --git a/stats/include/kurator/stats/BaseLog.inl.h b/stats/include/kurator/stats/BaseLog.inl.h new file mode 100644 index 0000000..288f105 --- /dev/null +++ b/stats/include/kurator/stats/BaseLog.inl.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + + +namespace kurator +{ +namespace stats +{ + + +template +template +void +BaseLog::push_back(Event event) +{ + events.push_back(std::move(event)); +} + + +template +template +void +BaseLog::for_each(Visitor visitor) const +{ + for (const auto& event : events) + std::visit(visitor, event); +} + + +} // namespace stats +} // namespace kurator -- cgit v1.1