xbmc
Service.h
1 /*
2  * Copyright (C) 2005-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 "addons/Addon.h"
12 #include "addons/AddonEvents.h"
13 #include "threads/CriticalSection.h"
14 
15 namespace ADDON
16 {
17  class CService: public CAddon
18  {
19  public:
20  explicit CService(const AddonInfoPtr& addonInfo);
21  };
22 
24  {
25  public:
26  explicit CServiceAddonManager(CAddonMgr& addonMgr);
28 
32  void Start();
33 
37  void Start(const AddonPtr& addon);
38  void Start(const std::string& addonId);
39 
43  void Stop();
44 
48  void Stop(const std::string& addonId);
49 
50  private:
51  void OnEvent(const AddonEvent& event);
52 
53  void Stop(const std::map<std::string, int>::value_type& service);
54 
55  CAddonMgr& m_addonMgr;
56  CCriticalSection m_criticalSection;
58  std::map<std::string, int> m_services;
59  };
60 }
Class - CAddonMgr Holds references to all addons, enabled or otherwise.
Definition: AddonManager.h:79
Definition: Service.h:23
Definition: AddonEvents.h:18
Definition: Service.h:17
Definition: Addon.cpp:39
Definition: Addon.h:34