1 | /* $Id: UICloudEntityKey.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UICloudEntityKey class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_manager_UICloudEntityKey_h
|
---|
29 | #define FEQT_INCLUDED_SRC_manager_UICloudEntityKey_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QHash>
|
---|
36 | #include <QString>
|
---|
37 | #include <QUuid>
|
---|
38 |
|
---|
39 | /** Cloud entity key definition.
|
---|
40 | * This is a key for various indexed containers,
|
---|
41 | * allowing to distinguish one cloud entity from another. */
|
---|
42 | struct UICloudEntityKey
|
---|
43 | {
|
---|
44 | /** Constructs cloud entity key on the basis of passed parameters.
|
---|
45 | * @param strProviderShortName Brings provider short name.
|
---|
46 | * @param strProfileName Brings profile name.
|
---|
47 | * @param uMachineId Brings machine id. */
|
---|
48 | UICloudEntityKey(const QString &strProviderShortName = QString(),
|
---|
49 | const QString &strProfileName = QString(),
|
---|
50 | const QUuid &uMachineId = QUuid());
|
---|
51 | /** Constructs cloud entity key on the basis of @a another one. */
|
---|
52 | UICloudEntityKey(const UICloudEntityKey &another);
|
---|
53 |
|
---|
54 | /** Returns whether this one key equals to @a another one. */
|
---|
55 | bool operator==(const UICloudEntityKey &another) const;
|
---|
56 | /** Returns whether this one key is less than @a another one. */
|
---|
57 | bool operator<(const UICloudEntityKey &another) const;
|
---|
58 |
|
---|
59 | /** Returns string key representation. */
|
---|
60 | QString toString() const;
|
---|
61 |
|
---|
62 | /** Holds provider short name. */
|
---|
63 | QString m_strProviderShortName;
|
---|
64 | /** Holds profile name. */
|
---|
65 | QString m_strProfileName;
|
---|
66 | /** Holds machine id. */
|
---|
67 | QUuid m_uMachineId;
|
---|
68 | };
|
---|
69 |
|
---|
70 | inline size_t qHash(const UICloudEntityKey &key, size_t uSeed)
|
---|
71 | {
|
---|
72 | return qHash(key.toString(), uSeed);
|
---|
73 | }
|
---|
74 |
|
---|
75 | #endif /* !FEQT_INCLUDED_SRC_manager_UICloudEntityKey_h */
|
---|