2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Denis Mingulov
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2010-07-16 11:18:30 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-07-16 11:18:30 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QMetaType>
|
|
|
|
|
#include <QString>
|
2010-07-16 11:18:30 +02:00
|
|
|
|
2011-11-11 19:19:11 +01:00
|
|
|
#include <limits.h>
|
|
|
|
|
|
2010-07-16 11:18:30 +02:00
|
|
|
namespace ClassView {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class SymbolInformation
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SymbolInformation();
|
|
|
|
|
SymbolInformation(const QString &name, const QString &type, int iconType = INT_MIN);
|
|
|
|
|
|
|
|
|
|
bool operator<(const SymbolInformation &other) const;
|
|
|
|
|
|
|
|
|
|
inline const QString &name() const { return m_name; }
|
|
|
|
|
inline const QString &type() const { return m_type; }
|
|
|
|
|
inline int iconType() const { return m_iconType; }
|
2021-07-07 17:32:53 +02:00
|
|
|
inline auto hash() const { return m_hash; }
|
2010-07-19 09:37:09 +02:00
|
|
|
inline bool operator==(const SymbolInformation &other) const
|
|
|
|
|
{
|
2021-02-16 01:37:49 +01:00
|
|
|
return hash() == other.hash() && iconType() == other.iconType() && name() == other.name()
|
2010-07-19 09:37:09 +02:00
|
|
|
&& type() == other.type();
|
|
|
|
|
}
|
2010-07-16 11:18:30 +02:00
|
|
|
|
|
|
|
|
int iconTypeSortOrder() const;
|
|
|
|
|
|
2021-12-06 05:11:04 +01:00
|
|
|
friend auto qHash(const SymbolInformation &information) { return information.hash(); }
|
|
|
|
|
|
2010-07-16 11:18:30 +02:00
|
|
|
private:
|
2021-02-16 01:37:49 +01:00
|
|
|
const int m_iconType;
|
2022-07-13 09:27:18 +02:00
|
|
|
const size_t m_hash; // precalculated hash value - to speed up qHash
|
2021-02-16 01:37:49 +01:00
|
|
|
const QString m_name; // symbol name (e.g. SymbolInformation)
|
|
|
|
|
const QString m_type; // symbol type (e.g. (int char))
|
2010-07-16 11:18:30 +02:00
|
|
|
};
|
|
|
|
|
|
2010-07-19 09:37:09 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ClassView
|
|
|
|
|
|
2010-07-16 11:18:30 +02:00
|
|
|
Q_DECLARE_METATYPE(ClassView::Internal::SymbolInformation)
|