Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / addons / BinaryAddonCache.h
blob5536c9ff00e3a47a9a61439377960d5b456c113d
1 /*
2 * Copyright (C) 2016-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "threads/CriticalSection.h"
13 #include <map>
14 #include <memory>
15 #include <vector>
17 namespace ADDON
20 enum class AddonType;
22 class IAddon;
23 using AddonPtr = std::shared_ptr<IAddon>;
24 using VECADDONS = std::vector<AddonPtr>;
26 struct AddonEvent;
28 class CBinaryAddonCache
30 public:
31 virtual ~CBinaryAddonCache();
32 void Init();
33 void Deinit();
34 void GetAddons(VECADDONS& addons, AddonType type);
35 void GetDisabledAddons(VECADDONS& addons, AddonType type);
36 void GetInstalledAddons(VECADDONS& addons, AddonType type);
37 AddonPtr GetAddonInstance(const std::string& strId, AddonType type);
39 protected:
40 void Update();
41 void OnEvent(const AddonEvent& event);
43 CCriticalSection m_critSection;
44 std::multimap<AddonType, VECADDONS> m_addons;
47 } // namespace ADDON