version 0.4.1
controllogger.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers mueller@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
9#pragma once
10#include "observer.hh"
11#include "observermessages.hh"
12
13#include <chrono>
14
15namespace Ikarus {
22class ControlLogger : public IObserver<ControlMessages>
23{
24public:
30 void updateImpl(ControlMessages message) final;
37 void updateImpl(ControlMessages message, const std::string& val) final;
45 void updateImpl(ControlMessages message, int val1, const std::string& val2) final;
53 void updateImpl(ControlMessages message, int val1, double val2) final;
54
55private:
56 using TimePoint = std::chrono::time_point<std::chrono::high_resolution_clock>;
57 TimePoint start_{};
58 TimePoint stop_{};
59 std::chrono::milliseconds duration_{};
60};
61} // namespace Ikarus
Enums for observer messages.
Implementation of the observer design pattern.
ControlMessages
Enum class defining control-routine-related messages.
Definition: observermessages.hh:17
Definition: assemblermanipulatorbuildingblocks.hh:22
ControlLogger class for logging control messages.
Definition: controllogger.hh:23
void updateImpl(ControlMessages message) final
Implementation of the update method for control message logging.
void updateImpl(ControlMessages message, int val1, const std::string &val2) final
Implementation of the update method for logging control messages with an integer and a string value.
void updateImpl(ControlMessages message, const std::string &val) final
Implementation of the update method for logging control messages with string values.
void updateImpl(ControlMessages message, int val1, double val2) final
Implementation of the update method for logging control messages with an integer and a double value.
Generic observer interface for the Observer design pattern. See for a description of the design patt...
Definition: observer.hh:26