Merge pull request #26076 from notspiff/seekhandler_seektype_enum_class
[xbmc.git] / xbmc / pvr / addons / PVRClientUID.h
bloba3c5fd31fc4710e330f89b9bebda320194d08cf5
1 /*
2 * Copyright (C) 2012-2022 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 "addons/IAddon.h"
13 #include <string>
15 namespace PVR
17 class CPVRClientUID final
19 public:
20 CPVRClientUID(const std::string& addonID, ADDON::AddonInstanceId instanceID)
21 : m_addonID(addonID), m_instanceID(instanceID)
25 virtual ~CPVRClientUID() = default;
27 /*!
28 * @brief Return the numeric UID.
29 * @return The numeric UID, or PVR_CLIENT_INVALID_UID on error.
31 int GetUID() const;
33 /*!
34 * @brief Return the numeric legacy UID (compatibility/migration purposes only).
35 * @return The numeric legacy UID.
37 int GetLegacyUID() const;
39 private:
40 CPVRClientUID() = delete;
42 std::string m_addonID;
43 ADDON::AddonInstanceId m_instanceID{ADDON::ADDON_SINGLETON_INSTANCE_ID};
45 mutable bool m_uidCreated{false};
46 mutable int m_uid{0};
48 } // namespace PVR