IDS peak genericC++  v1.4.3
peak_timeout.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
14 
15 #include <chrono>
16 #include <cstdint>
17 
18 namespace peak
19 {
20 namespace core
21 {
22 
30 class Timeout
31 {
32 public:
38  static const uint64_t INFINITE_TIMEOUT = PEAK_INFINITE_TIMEOUT;
39 
40  Timeout(uint64_t timeout = 0) noexcept
41  : m_timeout(timeout)
42  {}
43 
44  Timeout(std::chrono::milliseconds timeout) noexcept
45  : m_timeout(timeout)
46  {}
47 
48  operator uint64_t() const
49  {
50  return static_cast<uint64_t>(m_timeout.count());
51  }
52 
53 private:
54  std::chrono::milliseconds m_timeout;
55 };
56 
57 } /* namespace core */
58 } /* namespace peak */
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
Timeout(uint64_t timeout=0) noexcept
Definition: peak_timeout.hpp:40
static const uint64_t INFINITE_TIMEOUT
The constant defining an infinite timeout.
Definition: peak_timeout.hpp:38
Represents a timeout value in milliseconds.
Definition: peak_timeout.hpp:30
Timeout(std::chrono::milliseconds timeout) noexcept
Definition: peak_timeout.hpp:44
const uint64_t PEAK_INFINITE_TIMEOUT
Definition: peak_backend.h:341