summaryrefslogtreecommitdiffstats
path: root/xbmc/pvr/addons/PVRClientUID.h
blob: 5b5d1c05071e2a75ebf0e82a973bd469093bb234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 *  Copyright (C) 2012-2022 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "addons/IAddon.h"

#include <string>

namespace PVR
{
class CPVRClientUID final
{
public:
  CPVRClientUID(const std::string& addonID, ADDON::AddonInstanceId instanceID)
    : m_addonID(addonID), m_instanceID(instanceID)
  {
  }

  virtual ~CPVRClientUID() = default;

  /*!
   * @brief Return the numeric UID.
   * @return The numeric UID.
   */
  int GetUID() const;

private:
  CPVRClientUID() = delete;

  std::string m_addonID;
  ADDON::AddonInstanceId m_instanceID{ADDON::ADDON_SINGLETON_INSTANCE_ID};

  mutable bool m_uidCreated{false};
  mutable int m_uid{0};
};
} // namespace PVR