kodi
BinaryAddonCache.h
1 /*
2  * Copyright (C) 2016-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "threads/CriticalSection.h"
12 
13 #include <map>
14 #include <memory>
15 #include <vector>
16 
17 namespace ADDON
18 {
19 
20 enum class AddonType;
21 
22 class IAddon;
23 using AddonPtr = std::shared_ptr<IAddon>;
24 using VECADDONS = std::vector<AddonPtr>;
25 
26 struct AddonEvent;
27 
29 {
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);
38 
39 protected:
40  void Update();
41  void OnEvent(const AddonEvent& event);
42 
43  CCriticalSection m_critSection;
44  std::multimap<AddonType, VECADDONS> m_addons;
45 };
46 
47 } // namespace ADDON
Definition: BinaryAddonCache.h:28
Definition: AddonEvents.h:18
Definition: Addon.cpp:39