Imt.Base C++ API V4.1.1.0
Loading...
Searching...
No Matches
MockThread.h
Go to the documentation of this file.
1// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
2
3#ifndef IMT_BASE_OS_LINUX_GMOCK_MOCKTHREAD_H
4#define IMT_BASE_OS_LINUX_GMOCK_MOCKTHREAD_H
5
6#include <gmock/gmock.h>
9
10namespace imt {
11namespace base {
12namespace os {
13namespace linux {
14namespace gmock {
15
20
21public:
22
24
25 MOCK_METHOD(void, init, (std::string const& threadName, ::imt::base::os::linux::ThreadSchedulingParams schedulingParams, std::function<void()> threadFunction));
26 MOCK_METHOD(void, start, (std::string const& threadName));
27 MOCK_METHOD(void, stop, (std::string const& threadName));
28 MOCK_METHOD(bool, isStopRequested, (std::string const& threadName));
29 MOCK_METHOD(void, waitFor, (std::chrono::milliseconds const waitTimeMs));
30
31 void run(std::string const& threadName);
32
33private:
34
35 struct ThreadInfo {
36 ThreadInfo(::imt::base::os::linux::ThreadSchedulingParams schedulingParams, std::function<void()> threadFunction);
37
39 std::function<void()> m_function;
40 bool m_isStopRequested {false};
41 };
42
43 std::map<std::string, ThreadInfo> m_threadMap;
44};
45
46} // namespace gmock
47} // namespace linux
48} // namespace os
49} // namespace base
50} // namespace imt
51
52#endif // #ifndef IMT_BASE_OS_LINUX_GMOCK_MOCKTHREAD_H
Provides the parameters required to setup the scheduling of a thread.
Mock thread implementation.
Definition MockThread.h:19
MOCK_METHOD(void, start,(std::string const &threadName))
MOCK_METHOD(bool, isStopRequested,(std::string const &threadName))
MOCK_METHOD(void, waitFor,(std::chrono::milliseconds const waitTimeMs))
MOCK_METHOD(void, init,(std::string const &threadName, ::imt::base::os::linux::ThreadSchedulingParams schedulingParams, std::function< void()> threadFunction))
void run(std::string const &threadName)
MOCK_METHOD(void, stop,(std::string const &threadName))
This is a application specific file which is used to configure Imt.Base.Core.Math.