RobotsIO
Loading...
Searching...
No Matches
ClockedComponent.h
1/*
2 * Copyright (C) 2020 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This software may be modified and distributed under the terms of the
5 * BSD 3-Clause license. See the accompanying LICENSE file for details.
6 */
7
8#ifndef ROBOTSIO_CLOCKEDCOMPONENT_H
9#define ROBOTSIO_CLOCKEDCOMPONENT_H
10
11#include <RobotsIO/Utils/Clock.h>
12
13#include <memory>
14
15namespace RobotsIO {
16 namespace Utils {
17 class ClockedComponent;
18 }
19}
20
22{
23public:
25
26 void start_count();
27
28 double stop_count() const;
29
30 Clock& clock();
31
32 void replace_clock(std::shared_ptr<Clock> clock);
33
34private:
35 std::shared_ptr<RobotsIO::Utils::Clock> clock_;
36
37 double current_time_;
38};
39
40#endif /* ROBOTSIO_CLOCKEDCOMPONENT_H */