1 // Copyright (C) 2015-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
2 // This Source Code Form is subject to the terms of the Mozilla Public
3 // License, v. 2.0. If a copy of the MPL was not distributed with this
4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 
6 #ifndef NPDU_TESTS_NPDUTESTROUTINGMANAGERDAEMON_HPP_
7 #define NPDU_TESTS_NPDUTESTROUTINGMANAGERDAEMON_HPP_
8 
9 #include <gtest/gtest.h>
10 
11 #include <vsomeip/vsomeip.hpp>
12 
13 #include <thread>
14 #include <mutex>
15 #include <condition_variable>
16 #include <functional>
17 
18 class npdu_test_rmd {
19 
20 public:
21     npdu_test_rmd();
22     void init();
23     void start();
24     void stop();
25     void on_state(vsomeip::state_type_e _state);
26     void on_message_shutdown(const std::shared_ptr<vsomeip::message> &_request);
27     void join_shutdown_thread();
28     void run();
29 
30 private:
31     std::shared_ptr<vsomeip::application> app_;
32     bool is_registered_;
33 
34     std::mutex mutex_;
35     std::mutex mutex2_;
36     std::condition_variable condition_;
37     std::condition_variable condition2_;
38     bool blocked_;
39     bool blocked2_;
40     std::thread offer_thread_;
41     std::thread shutdown_thread_;
42 
43 };
44 
45 #endif /* NPDU_TESTS_NPDUTESTROUTINGMANAGERDAEMON_HPP_ */
46