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_POLICY_MANAGER_IMPL_HPP_ 7 #define VSOMEIP_V3_POLICY_MANAGER_IMPL_HPP_ 8 9 #include <memory> 10 #include <mutex> 11 12 #include <vsomeip/primitive_types.hpp> 13 #include <vsomeip/internal/policy_manager.hpp> 14 15 #include "../include/policy.hpp" 16 #include "../../configuration/include/configuration_element.hpp" 17 18 namespace vsomeip_v3 { 19 20 class policy_manager_impl 21 : public policy_manager { 22 public: 23 static std::shared_ptr<policy_manager> get(); 24 25 virtual ~policy_manager_impl(); 26 27 std::shared_ptr<policy> create_policy() const; 28 void print_policy(const std::shared_ptr<policy> &_policy) const; 29 30 bool parse_uid_gid(const byte_t* &_buffer, uint32_t &_buffer_size, 31 uint32_t &_uid, uint32_t &_gid) const; 32 bool parse_policy(const byte_t* &_buffer, uint32_t &_buffer_size, 33 uint32_t &_uid, uint32_t &_gid, 34 const std::shared_ptr<policy> &_policy) const; 35 36 bool is_policy_update_allowed(uint32_t _uid, 37 std::shared_ptr<policy> &_policy) const; 38 bool is_policy_removal_allowed(uint32_t _uid) const; 39 }; 40 41 } // namespace vsomeip_v3 42 43 #endif // VSOMEIP_V3_POLICY_MANAGER_IMPL_HPP_ 44