libfranka
0.14.1
FCI C++ API
Toggle main menu visibility
Loading...
Searching...
No Matches
include
franka
duration.h
Go to the documentation of this file.
1
// Copyright (c) 2023 Franka Robotics GmbH
2
// Use of this source code is governed by the Apache-2.0 license, see LICENSE
3
#pragma once
4
5
#include <chrono>
6
#include <cstdint>
7
#include <ratio>
8
13
14
namespace
franka {
15
19
class
Duration
{
20
public
:
24
Duration
() noexcept;
25
31
explicit
Duration
(uint64_t milliseconds) noexcept;
32
38
Duration
(std::chrono::duration<uint64_t, std::milli> duration) noexcept;
39
43
Duration
(const
Duration
&) = default;
44
50
Duration
& operator=(const
Duration
&) = default;
51
57
operator std::chrono::duration<uint64_t, std::milli>() const noexcept;
58
64
double
toSec
() const noexcept;
65
71
uint64_t
toMSec
() const noexcept;
72
77
85
Duration
operator+(const
Duration
& rhs) const noexcept;
93
Duration
& operator+=(const
Duration
& rhs) noexcept;
94
102
Duration
operator-(const
Duration
& rhs) const noexcept;
110
Duration
& operator-=(const
Duration
& rhs) noexcept;
111
119
Duration
operator*(uint64_t rhs) const noexcept;
127
Duration
& operator*=(uint64_t rhs) noexcept;
128
136
uint64_t operator/(const
Duration
& rhs) const noexcept;
144
Duration
operator/(uint64_t rhs) const noexcept;
152
Duration
& operator/=(uint64_t rhs) noexcept;
153
161
Duration
operator%(const
Duration
& rhs) const noexcept;
169
Duration
operator%(uint64_t rhs) const noexcept;
177
Duration
& operator%=(const
Duration
& rhs) noexcept;
185
Duration
& operator%=(uint64_t rhs) noexcept;
186
190
195
203
bool
operator==(const
Duration
& rhs) const noexcept;
211
bool
operator!=(const
Duration
& rhs) const noexcept;
212
220
bool
operator<(const
Duration
& rhs) const noexcept;
228
bool
operator<=(const
Duration
& rhs) const noexcept;
229
237
bool
operator>(const
Duration
& rhs) const noexcept;
245
bool
operator>=(const
Duration
& rhs) const noexcept;
246
250
251
private:
252
std::chrono::duration<uint64_t, std::milli> duration_;
253
};
254
263
Duration
operator*(uint64_t lhs, const
Duration
& rhs) noexcept;
264
265
}
// namespace franka
franka::Duration
Represents a duration with millisecond resolution.
Definition
duration.h:19
franka::Duration::toMSec
uint64_t toMSec() const noexcept
Returns the stored duration in .
franka::Duration::toSec
double toSec() const noexcept
Returns the stored duration in .
franka::Duration::Duration
Duration() noexcept
Creates a new Duration instance with zero milliseconds.
Generated by
1.17.0