// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #ifndef JUNGFRAUJOCH_PREVIEWCOUNTER_H #define JUNGFRAUJOCH_PREVIEWCOUNTER_H #include #include #include #include class PreviewCounter { mutable std::mutex m; std::optional period; std::chrono::time_point last_preview; public: PreviewCounter(const std::optional &period); PreviewCounter& Period(const std::optional &period); bool GeneratePreview(); std::optional GetPeriod() const; }; #endif //JUNGFRAUJOCH_PREVIEWCOUNTER_H