1 // Copyright (C) 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 VSOMEIP_V3_CONFIGURATION_CONFIGURATION_PLUGIN_IMPL_HPP_
7 #define VSOMEIP_V3_CONFIGURATION_CONFIGURATION_PLUGIN_IMPL_HPP_
8 
9 #include <map>
10 #include <mutex>
11 
12 #include <vsomeip/plugin.hpp>
13 
14 #include "configuration_plugin.hpp"
15 
16 namespace vsomeip_v3 {
17 namespace cfg {
18 
19     class configuration_impl;
20 
21 } // namespace cfg
22 
23 class configuration_plugin_impl
24     : public configuration_plugin,
25       public plugin_impl<configuration_plugin_impl> {
26 public:
27     configuration_plugin_impl();
28     virtual ~configuration_plugin_impl();
29 
30     std::shared_ptr<configuration> get_configuration(const std::string &_name);
31 
32 private:
33     std::mutex mutex_;
34     std::shared_ptr<cfg::configuration_impl> default_;
35 #ifdef VSOMEIP_ENABLE_CONFIGURATION_OVERLAYS
36     std::map<std::string, std::shared_ptr<cfg::configuration_impl> > configurations_;
37 #endif // VSOMEIP_ENABLE_CONFIGURATION_OVERLAYS
38 };
39 
40 } // namespace vsomeip_v3
41 
42 #endif // VSOMEIP_V3_CONFIGURATION_CONFIGURATION_PLUGIN_IMPL_HPP_
43