forked from qt-creator/qt-creator
Clang: Improve interfaces
The interfaces should never used to handle ownership. So it is now using protected destructors. Copy operations are forbidden too. https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-nonvirtual Change-Id: Ib0b60a73a7ec130973b5cb0095cc5b2f10fa0758 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -45,6 +45,9 @@ public:
|
|||||||
|
|
||||||
void setIoDevice(QIODevice *ioDevice);
|
void setIoDevice(QIODevice *ioDevice);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~BaseServerProxy() = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ClangBackEnd::WriteMessageBlock m_writeMessageBlock;
|
ClangBackEnd::WriteMessageBlock m_writeMessageBlock;
|
||||||
ClangBackEnd::ReadMessageBlock m_readMessageBlock;
|
ClangBackEnd::ReadMessageBlock m_readMessageBlock;
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ public:
|
|||||||
virtual void references(const ReferencesMessage &message) = 0;
|
virtual void references(const ReferencesMessage &message) = 0;
|
||||||
virtual void followSymbol(const FollowSymbolMessage &message) = 0;
|
virtual void followSymbol(const FollowSymbolMessage &message) = 0;
|
||||||
virtual void tooltip(const ToolTipMessage &message) = 0;
|
virtual void tooltip(const ToolTipMessage &message) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ClangCodeModelClientInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -33,15 +33,20 @@ namespace ClangBackEnd {
|
|||||||
|
|
||||||
class ClangPathWatcherNotifier;
|
class ClangPathWatcherNotifier;
|
||||||
|
|
||||||
class CLANGSUPPORT_EXPORT ClangPathWatcherInterface
|
class ClangPathWatcherInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~ClangPathWatcherInterface();
|
ClangPathWatcherInterface() = default;
|
||||||
|
ClangPathWatcherInterface(const ClangPathWatcherInterface &) = delete;
|
||||||
|
ClangPathWatcherInterface &operator=(const ClangPathWatcherInterface &) = delete;
|
||||||
|
|
||||||
virtual void updateIdPaths(const std::vector<IdPaths> &idPaths) = 0;
|
virtual void updateIdPaths(const std::vector<IdPaths> &idPaths) = 0;
|
||||||
virtual void removeIds(const Utils::SmallStringVector &ids) = 0;
|
virtual void removeIds(const Utils::SmallStringVector &ids) = 0;
|
||||||
|
|
||||||
virtual void setNotifier(ClangPathWatcherNotifier *notifier) = 0;
|
virtual void setNotifier(ClangPathWatcherNotifier *notifier) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ClangPathWatcherInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -33,16 +33,18 @@
|
|||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
class CLANGSUPPORT_EXPORT ClangPathWatcherNotifier
|
class ClangPathWatcherNotifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClangPathWatcherNotifier() = default;
|
ClangPathWatcherNotifier() = default;
|
||||||
virtual ~ClangPathWatcherNotifier();
|
|
||||||
ClangPathWatcherNotifier(const ClangPathWatcherNotifier &) = delete;
|
ClangPathWatcherNotifier(const ClangPathWatcherNotifier &) = delete;
|
||||||
void operator=(const ClangPathWatcherNotifier &) = delete;
|
ClangPathWatcherNotifier &operator=(const ClangPathWatcherNotifier &) = delete;
|
||||||
|
|
||||||
virtual void pathsWithIdsChanged(const Utils::SmallStringVector &ids) = 0;
|
virtual void pathsWithIdsChanged(const Utils::SmallStringVector &ids) = 0;
|
||||||
virtual void pathsChanged(const FilePathIds &filePathIds) = 0;
|
virtual void pathsChanged(const FilePathIds &filePathIds) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ClangPathWatcherNotifier() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ SOURCES += \
|
|||||||
$$PWD/clangcodemodelconnectionclient.cpp \
|
$$PWD/clangcodemodelconnectionclient.cpp \
|
||||||
$$PWD/clangcodemodelserverinterface.cpp \
|
$$PWD/clangcodemodelserverinterface.cpp \
|
||||||
$$PWD/clangcodemodelserverproxy.cpp \
|
$$PWD/clangcodemodelserverproxy.cpp \
|
||||||
$$PWD/clangpathwatcherinterface.cpp \
|
|
||||||
$$PWD/clangpathwatchernotifier.cpp \
|
|
||||||
$$PWD/cmbalivemessage.cpp \
|
$$PWD/cmbalivemessage.cpp \
|
||||||
$$PWD/cmbcodecompletedmessage.cpp \
|
$$PWD/cmbcodecompletedmessage.cpp \
|
||||||
$$PWD/cmbcompletecodemessage.cpp \
|
$$PWD/cmbcompletecodemessage.cpp \
|
||||||
@@ -41,9 +39,6 @@ SOURCES += \
|
|||||||
$$PWD/filepath.cpp \
|
$$PWD/filepath.cpp \
|
||||||
$$PWD/fixitcontainer.cpp \
|
$$PWD/fixitcontainer.cpp \
|
||||||
$$PWD/followsymbolmessage.cpp \
|
$$PWD/followsymbolmessage.cpp \
|
||||||
$$PWD/ipcclientinterface.cpp \
|
|
||||||
$$PWD/ipcinterface.cpp \
|
|
||||||
$$PWD/ipcserverinterface.cpp \
|
|
||||||
$$PWD/lineprefixer.cpp \
|
$$PWD/lineprefixer.cpp \
|
||||||
$$PWD/messageenvelop.cpp \
|
$$PWD/messageenvelop.cpp \
|
||||||
$$PWD/pchmanagerclientinterface.cpp \
|
$$PWD/pchmanagerclientinterface.cpp \
|
||||||
@@ -92,8 +87,7 @@ SOURCES += \
|
|||||||
$$PWD/writemessageblock.cpp \
|
$$PWD/writemessageblock.cpp \
|
||||||
$$PWD/filepathcaching.cpp \
|
$$PWD/filepathcaching.cpp \
|
||||||
$$PWD/filepathid.cpp \
|
$$PWD/filepathid.cpp \
|
||||||
$$PWD/baseserverproxy.cpp \
|
$$PWD/baseserverproxy.cpp
|
||||||
$$PWD/projectpartpchproviderinterface.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/cancelmessage.h \
|
$$PWD/cancelmessage.h \
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ class CLANGSUPPORT_EXPORT ConnectionClient : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ConnectionClient(const QString &connectionName);
|
ConnectionClient(const QString &connectionName);
|
||||||
virtual ~ConnectionClient();
|
|
||||||
|
ConnectionClient(const ConnectionClient &) = delete;
|
||||||
|
ConnectionClient &operator=(const ConnectionClient &) = delete;
|
||||||
|
|
||||||
void startProcessAndConnectToServerAsynchronously();
|
void startProcessAndConnectToServerAsynchronously();
|
||||||
void disconnectFromServer();
|
void disconnectFromServer();
|
||||||
@@ -82,6 +84,9 @@ signals:
|
|||||||
void disconnectedFromLocalSocket();
|
void disconnectedFromLocalSocket();
|
||||||
void processFinished();
|
void processFinished();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ConnectionClient();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QIODevice *ioDevice();
|
QIODevice *ioDevice();
|
||||||
const QTemporaryDir &temporaryDirectory() const;
|
const QTemporaryDir &temporaryDirectory() const;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
template <typename FilePathStorage>
|
template <typename FilePathStorage>
|
||||||
class CLANGSUPPORT_GCCEXPORT FilePathCache
|
class FilePathCache
|
||||||
{
|
{
|
||||||
using DirectoryPathCache = StringCache<Utils::PathString,
|
using DirectoryPathCache = StringCache<Utils::PathString,
|
||||||
int,
|
int,
|
||||||
@@ -53,6 +53,9 @@ public:
|
|||||||
: m_filePathStorage(filePathStorage)
|
: m_filePathStorage(filePathStorage)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
FilePathCache(const FilePathCache &) = delete;
|
||||||
|
FilePathCache &operator=(const FilePathCache &) = delete;
|
||||||
|
|
||||||
FilePathId filePathId(FilePathView filePath) const
|
FilePathId filePathId(FilePathView filePath) const
|
||||||
{
|
{
|
||||||
Utils::SmallStringView directoryPath = filePath.directory();
|
Utils::SmallStringView directoryPath = filePath.directory();
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ namespace ClangBackEnd {
|
|||||||
class FilePathCachingInterface
|
class FilePathCachingInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
FilePathCachingInterface() = default;
|
||||||
|
FilePathCachingInterface(const FilePathCachingInterface &) = delete;
|
||||||
|
FilePathCachingInterface &operator=(const FilePathCachingInterface &) = delete;
|
||||||
|
|
||||||
virtual FilePathId filePathId(FilePathView filePath) const = 0;
|
virtual FilePathId filePathId(FilePathView filePath) const = 0;
|
||||||
virtual FilePath filePath(FilePathId filePathId) const = 0;
|
virtual FilePath filePath(FilePathId filePathId) const = 0;
|
||||||
|
|
||||||
@@ -69,6 +73,9 @@ public:
|
|||||||
|
|
||||||
return filePaths;
|
return filePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~FilePathCachingInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -29,10 +29,10 @@
|
|||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
class CLANGSUPPORT_EXPORT IpcClientInterface : public IpcInterface
|
class IpcClientInterface : public IpcInterface
|
||||||
{
|
{
|
||||||
public:
|
protected:
|
||||||
IpcClientInterface();
|
~IpcClientInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -33,11 +33,17 @@ namespace ClangBackEnd {
|
|||||||
|
|
||||||
class MessageEnvelop;
|
class MessageEnvelop;
|
||||||
|
|
||||||
class CLANGSUPPORT_EXPORT IpcInterface
|
class IpcInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~IpcInterface();
|
IpcInterface() = default;
|
||||||
|
IpcInterface(const IpcInterface &) = delete;
|
||||||
|
IpcInterface &operator=(const IpcInterface &) = delete;
|
||||||
|
|
||||||
virtual void dispatch(const MessageEnvelop &messageEnvelop) = 0;
|
virtual void dispatch(const MessageEnvelop &messageEnvelop) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~IpcInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ namespace ClangBackEnd {
|
|||||||
|
|
||||||
class IpcServerInterface : public IpcInterface
|
class IpcServerInterface : public IpcInterface
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
~IpcServerInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ public:
|
|||||||
|
|
||||||
virtual void alive() = 0;
|
virtual void alive() = 0;
|
||||||
virtual void precompiledHeadersUpdated(PrecompiledHeadersUpdatedMessage &&message) = 0;
|
virtual void precompiledHeadersUpdated(PrecompiledHeadersUpdatedMessage &&message) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PchManagerClientInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ public:
|
|||||||
void dispatch(const MessageEnvelop &messageEnvelop) override;
|
void dispatch(const MessageEnvelop &messageEnvelop) override;
|
||||||
|
|
||||||
virtual void end() = 0;
|
virtual void end() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PchManagerServerInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -32,11 +32,14 @@ namespace ClangBackEnd {
|
|||||||
class RemoveProjectPartsMessage;
|
class RemoveProjectPartsMessage;
|
||||||
class UpdateProjectPartsMessage;
|
class UpdateProjectPartsMessage;
|
||||||
|
|
||||||
class CLANGSUPPORT_EXPORT ProjectManagementServerInterface : public IpcInterface
|
class ProjectManagementServerInterface : public IpcInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void updateProjectParts(UpdateProjectPartsMessage &&message) = 0;
|
virtual void updateProjectParts(UpdateProjectPartsMessage &&message) = 0;
|
||||||
virtual void removeProjectParts(RemoveProjectPartsMessage &&message) = 0;
|
virtual void removeProjectParts(RemoveProjectPartsMessage &&message) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ProjectManagementServerInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "projectpartpchproviderinterface.h"
|
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
|
||||||
|
|
||||||
ProjectPartPchProviderInterface::~ProjectPartPchProviderInterface()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
|
||||||
@@ -31,14 +31,20 @@
|
|||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
class CLANGSUPPORT_EXPORT ProjectPartPchProviderInterface
|
class ProjectPartPchProviderInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~ProjectPartPchProviderInterface();
|
ProjectPartPchProviderInterface() = default;
|
||||||
|
ProjectPartPchProviderInterface(const ProjectPartPchProviderInterface &) = delete;
|
||||||
|
ProjectPartPchProviderInterface &operator=(const ProjectPartPchProviderInterface &) = delete;
|
||||||
|
|
||||||
virtual Utils::optional<ClangBackEnd::ProjectPartPch> projectPartPch(
|
virtual Utils::optional<ClangBackEnd::ProjectPartPch> projectPartPch(
|
||||||
Utils::SmallStringView projectPartId) const = 0;
|
Utils::SmallStringView projectPartId) const = 0;
|
||||||
virtual const ClangBackEnd::ProjectPartPchs &projectPartPchs() const = 0;
|
virtual const ClangBackEnd::ProjectPartPchs &projectPartPchs() const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ProjectPartPchProviderInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ public:
|
|||||||
virtual void sourceRangesForQueryMessage(SourceRangesForQueryMessage &&message) = 0;
|
virtual void sourceRangesForQueryMessage(SourceRangesForQueryMessage &&message) = 0;
|
||||||
|
|
||||||
virtual void setLocalRenamingCallback(RenameCallback &&localRenamingCallback) = 0;
|
virtual void setLocalRenamingCallback(RenameCallback &&localRenamingCallback) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~RefactoringClientInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ public:
|
|||||||
isAvailable_ = isAvailable;
|
isAvailable_ = isAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~RefactoringServerInterface() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isAvailable_ = false;
|
bool isAvailable_ = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -131,6 +131,9 @@ public:
|
|||||||
m_indices.reserve(reserveSize);
|
m_indices.reserve(reserveSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringCache(const StringCache &) = delete;
|
||||||
|
StringCache &operator=(const StringCache &) = delete;
|
||||||
|
|
||||||
void populate(CacheEntries &&entries)
|
void populate(CacheEntries &&entries)
|
||||||
{
|
{
|
||||||
uncheckedPopulate(std::move(entries));
|
uncheckedPopulate(std::move(entries));
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ SOURCES += \
|
|||||||
$$PWD/sqliteglobal.cpp \
|
$$PWD/sqliteglobal.cpp \
|
||||||
$$PWD/sqlitereadstatement.cpp \
|
$$PWD/sqlitereadstatement.cpp \
|
||||||
$$PWD/sqlitereadwritestatement.cpp \
|
$$PWD/sqlitereadwritestatement.cpp \
|
||||||
$$PWD/sqlitetransaction.cpp \
|
|
||||||
$$PWD/sqlitewritestatement.cpp \
|
$$PWD/sqlitewritestatement.cpp \
|
||||||
$$PWD/sqlstatementbuilder.cpp \
|
$$PWD/sqlstatementbuilder.cpp \
|
||||||
$$PWD/sqlstatementbuilderexception.cpp \
|
$$PWD/sqlstatementbuilderexception.cpp \
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ class SQLITE_EXPORT BaseStatement
|
|||||||
public:
|
public:
|
||||||
explicit BaseStatement(Utils::SmallStringView sqlStatement, Database &database);
|
explicit BaseStatement(Utils::SmallStringView sqlStatement, Database &database);
|
||||||
|
|
||||||
|
BaseStatement(const BaseStatement &) = delete;
|
||||||
|
BaseStatement &operator=(const BaseStatement &) = delete;
|
||||||
|
|
||||||
static void deleteCompiledStatement(sqlite3_stmt *m_compiledStatement);
|
static void deleteCompiledStatement(sqlite3_stmt *m_compiledStatement);
|
||||||
|
|
||||||
bool next() const;
|
bool next() const;
|
||||||
@@ -123,6 +126,9 @@ public:
|
|||||||
|
|
||||||
Database &database() const;
|
Database &database() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~BaseStatement() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<sqlite3_stmt, void (*)(sqlite3_stmt*)> m_compiledStatement;
|
std::unique_ptr<sqlite3_stmt, void (*)(sqlite3_stmt*)> m_compiledStatement;
|
||||||
Database &m_database;
|
Database &m_database;
|
||||||
@@ -146,7 +152,7 @@ extern template SQLITE_EXPORT Utils::SmallString BaseStatement::fetchValue<Utils
|
|||||||
extern template SQLITE_EXPORT Utils::PathString BaseStatement::fetchValue<Utils::PathString>(int column) const;
|
extern template SQLITE_EXPORT Utils::PathString BaseStatement::fetchValue<Utils::PathString>(int column) const;
|
||||||
|
|
||||||
template <typename BaseStatement>
|
template <typename BaseStatement>
|
||||||
class SQLITE_EXPORT StatementImplementation : public BaseStatement
|
class StatementImplementation : public BaseStatement
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -290,6 +296,8 @@ public:
|
|||||||
return statement.template fetchValue<Type>(0);
|
return statement.template fetchValue<Type>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~StatementImplementation() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Resetter
|
struct Resetter
|
||||||
|
|||||||
@@ -55,10 +55,7 @@ public:
|
|||||||
Database(Utils::PathString &&databaseFilePath, JournalMode journalMode=JournalMode::Wal);
|
Database(Utils::PathString &&databaseFilePath, JournalMode journalMode=JournalMode::Wal);
|
||||||
|
|
||||||
Database(const Database &) = delete;
|
Database(const Database &) = delete;
|
||||||
bool operator=(const Database &) = delete;
|
Database &operator=(const Database &) = delete;
|
||||||
|
|
||||||
Database(Database &&) = delete;
|
|
||||||
bool operator=(Database &&) = delete;
|
|
||||||
|
|
||||||
void open();
|
void open();
|
||||||
void open(Utils::PathString &&databaseFilePath);
|
void open(Utils::PathString &&databaseFilePath);
|
||||||
|
|||||||
@@ -35,11 +35,10 @@ namespace Sqlite {
|
|||||||
class DatabaseBackend;
|
class DatabaseBackend;
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
class SQLITE_EXPORT TransactionInterface
|
class TransactionInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TransactionInterface() = default;
|
TransactionInterface() = default;
|
||||||
virtual ~TransactionInterface();
|
|
||||||
TransactionInterface(const TransactionInterface &) = delete;
|
TransactionInterface(const TransactionInterface &) = delete;
|
||||||
TransactionInterface &operator=(const TransactionInterface &) = delete;
|
TransactionInterface &operator=(const TransactionInterface &) = delete;
|
||||||
|
|
||||||
@@ -48,6 +47,9 @@ public:
|
|||||||
virtual void exclusiveBegin() = 0;
|
virtual void exclusiveBegin() = 0;
|
||||||
virtual void commit() = 0;
|
virtual void commit() = 0;
|
||||||
virtual void rollback() = 0;
|
virtual void rollback() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~TransactionInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AbstractTransaction
|
class AbstractTransaction
|
||||||
@@ -63,6 +65,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
~AbstractTransaction() = default;
|
||||||
AbstractTransaction(TransactionInterface &interface)
|
AbstractTransaction(TransactionInterface &interface)
|
||||||
: m_interface(interface)
|
: m_interface(interface)
|
||||||
{
|
{
|
||||||
@@ -76,6 +79,8 @@ protected:
|
|||||||
class AbstractThrowingTransaction : public AbstractTransaction
|
class AbstractThrowingTransaction : public AbstractTransaction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
AbstractThrowingTransaction(const AbstractThrowingTransaction &) = delete;
|
||||||
|
AbstractThrowingTransaction &operator=(const AbstractThrowingTransaction &) = delete;
|
||||||
~AbstractThrowingTransaction() noexcept(false)
|
~AbstractThrowingTransaction() noexcept(false)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -97,6 +102,8 @@ protected:
|
|||||||
class AbstractNonThrowingDestructorTransaction : public AbstractTransaction
|
class AbstractNonThrowingDestructorTransaction : public AbstractTransaction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
AbstractNonThrowingDestructorTransaction(const AbstractNonThrowingDestructorTransaction &) = delete;
|
||||||
|
AbstractNonThrowingDestructorTransaction &operator=(const AbstractNonThrowingDestructorTransaction &) = delete;
|
||||||
~AbstractNonThrowingDestructorTransaction()
|
~AbstractNonThrowingDestructorTransaction()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class BackendReceiver : public ClangBackEnd::ClangCodeModelClientInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BackendReceiver();
|
BackendReceiver();
|
||||||
~BackendReceiver() override;
|
~BackendReceiver();
|
||||||
|
|
||||||
using AliveHandler = std::function<void ()>;
|
using AliveHandler = std::function<void ()>;
|
||||||
void setAliveHandler(const AliveHandler &handler);
|
void setAliveHandler(const AliveHandler &handler);
|
||||||
|
|||||||
@@ -22,6 +22,5 @@ SOURCES += \
|
|||||||
$$PWD/pchmanagernotifierinterface.cpp \
|
$$PWD/pchmanagernotifierinterface.cpp \
|
||||||
$$PWD/pchmanagerconnectionclient.cpp \
|
$$PWD/pchmanagerconnectionclient.cpp \
|
||||||
$$PWD/projectupdater.cpp \
|
$$PWD/projectupdater.cpp \
|
||||||
$$PWD/pchmanagerprojectupdater.cpp \
|
$$PWD/pchmanagerprojectupdater.cpp
|
||||||
$$PWD/precompiledheaderstorageinterface.cpp
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ ClangPchManagerPlugin::~ClangPchManagerPlugin() = default;
|
|||||||
|
|
||||||
bool ClangPchManagerPlugin::initialize(const QStringList & /*arguments*/, QString * /*errorMessage*/)
|
bool ClangPchManagerPlugin::initialize(const QStringList & /*arguments*/, QString * /*errorMessage*/)
|
||||||
{
|
{
|
||||||
d.reset(new ClangPchManagerPluginData);
|
d = std::make_unique<ClangPchManagerPluginData>();
|
||||||
|
|
||||||
startBackend();
|
startBackend();
|
||||||
|
|
||||||
|
|||||||
@@ -37,17 +37,18 @@ class CLANGPCHMANAGER_EXPORT PchManagerNotifierInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PchManagerNotifierInterface(PchManagerClient &pchManagerClient);
|
PchManagerNotifierInterface(PchManagerClient &pchManagerClient);
|
||||||
|
PchManagerNotifierInterface(const PchManagerNotifierInterface &) = delete;
|
||||||
|
PchManagerNotifierInterface &operator=(const PchManagerNotifierInterface &) = delete;
|
||||||
|
|
||||||
virtual ~PchManagerNotifierInterface();
|
|
||||||
virtual void precompiledHeaderUpdated(const QString &projectPartId,
|
virtual void precompiledHeaderUpdated(const QString &projectPartId,
|
||||||
const QString &pchFilePath,
|
const QString &pchFilePath,
|
||||||
long long lastModified) = 0;
|
long long lastModified) = 0;
|
||||||
virtual void precompiledHeaderRemoved(const QString &projectPartId) = 0;
|
virtual void precompiledHeaderRemoved(const QString &projectPartId) = 0;
|
||||||
|
|
||||||
PchManagerNotifierInterface(const PchManagerNotifierInterface &) = delete;
|
|
||||||
void operator=(const PchManagerNotifierInterface &) const = delete;
|
|
||||||
|
|
||||||
PchManagerClient &m_pchManagerClient;
|
PchManagerClient &m_pchManagerClient;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PchManagerNotifierInterface();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangPchManager
|
} // namespace ClangPchManager
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2017 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "precompiledheaderstorageinterface.h"
|
|
||||||
|
|
||||||
namespace ClangPchManager {
|
|
||||||
|
|
||||||
PrecompiledHeaderStorageInterface::~PrecompiledHeaderStorageInterface() = default;
|
|
||||||
|
|
||||||
} // namespace ClangPchManager
|
|
||||||
@@ -33,7 +33,6 @@ class PrecompiledHeaderStorageInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PrecompiledHeaderStorageInterface() = default;
|
PrecompiledHeaderStorageInterface() = default;
|
||||||
virtual ~PrecompiledHeaderStorageInterface();
|
|
||||||
|
|
||||||
PrecompiledHeaderStorageInterface(const PrecompiledHeaderStorageInterface&) = delete;
|
PrecompiledHeaderStorageInterface(const PrecompiledHeaderStorageInterface&) = delete;
|
||||||
PrecompiledHeaderStorageInterface &operator=(const PrecompiledHeaderStorageInterface&) = delete;
|
PrecompiledHeaderStorageInterface &operator=(const PrecompiledHeaderStorageInterface&) = delete;
|
||||||
@@ -43,6 +42,9 @@ public:
|
|||||||
long long pchBuildTime) = 0;
|
long long pchBuildTime) = 0;
|
||||||
|
|
||||||
virtual void deletePrecompiledHeader(Utils::SmallStringView projectPartName) = 0;
|
virtual void deletePrecompiledHeader(Utils::SmallStringView projectPartName) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PrecompiledHeaderStorageInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangPchManager
|
} // namespace ClangPchManager
|
||||||
|
|||||||
@@ -39,7 +39,5 @@ SOURCES += \
|
|||||||
$$PWD/refactoringconnectionclient.cpp \
|
$$PWD/refactoringconnectionclient.cpp \
|
||||||
$$PWD/refactoringengine.cpp \
|
$$PWD/refactoringengine.cpp \
|
||||||
$$PWD/refactoringprojectupdater.cpp \
|
$$PWD/refactoringprojectupdater.cpp \
|
||||||
$$PWD/searchinterface.cpp \
|
|
||||||
$$PWD/searchhandle.cpp \
|
$$PWD/searchhandle.cpp \
|
||||||
$$PWD/symbolsfindfilter.cpp \
|
$$PWD/symbolsfindfilter.cpp
|
||||||
$$PWD/projectpartproviderinterface.cpp
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2017 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "projectpartproviderinterface.h"
|
|
||||||
|
|
||||||
namespace ClangRefactoring {
|
|
||||||
|
|
||||||
ProjectPartProviderInterface::~ProjectPartProviderInterface() = default;
|
|
||||||
|
|
||||||
} // namespace ClangRefactoring
|
|
||||||
@@ -39,7 +39,6 @@ class ProjectPartProviderInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProjectPartProviderInterface() = default;
|
ProjectPartProviderInterface() = default;
|
||||||
virtual ~ProjectPartProviderInterface();
|
|
||||||
|
|
||||||
ProjectPartProviderInterface(const ProjectPartProviderInterface&) = delete;
|
ProjectPartProviderInterface(const ProjectPartProviderInterface&) = delete;
|
||||||
ProjectPartProviderInterface& operator=(const ProjectPartProviderInterface&) = delete;
|
ProjectPartProviderInterface& operator=(const ProjectPartProviderInterface&) = delete;
|
||||||
@@ -49,6 +48,9 @@ public:
|
|||||||
|
|
||||||
virtual CppTools::ProjectPart *projectPart(const QString &projectPartId) const = 0;
|
virtual CppTools::ProjectPart *projectPart(const QString &projectPartId) const = 0;
|
||||||
virtual ClangBackEnd::V2::FileContainers generatedFiles() const = 0;
|
virtual ClangBackEnd::V2::FileContainers generatedFiles() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ProjectPartProviderInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangRefactoring
|
} // namespace ClangRefactoring
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ namespace ClangRefactoring {
|
|||||||
class SearchHandle
|
class SearchHandle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
SearchHandle() = default;
|
||||||
|
SearchHandle(const SearchHandle &) = delete;
|
||||||
|
SearchHandle &operator=(const SearchHandle &) = delete;
|
||||||
|
|
||||||
virtual ~SearchHandle();
|
virtual ~SearchHandle();
|
||||||
|
|
||||||
virtual void addResult(const QString &fileName,
|
virtual void addResult(const QString &fileName,
|
||||||
|
|||||||
@@ -36,9 +36,15 @@ namespace ClangRefactoring {
|
|||||||
class SearchInterface
|
class SearchInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~SearchInterface();
|
SearchInterface() = default;
|
||||||
|
SearchInterface(const SearchInterface &) = delete;
|
||||||
|
SearchInterface &operator=(const SearchInterface &) = delete;
|
||||||
|
|
||||||
virtual std::unique_ptr<SearchHandle> startNewSearch(const QString &searchLabel,
|
virtual std::unique_ptr<SearchHandle> startNewSearch(const QString &searchLabel,
|
||||||
const QString &searchTerm) = 0;
|
const QString &searchTerm) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~SearchInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangRefactoring
|
} // namespace ClangRefactoring
|
||||||
|
|||||||
@@ -47,7 +47,10 @@ enum class SymbolType
|
|||||||
class SymbolQueryInterface
|
class SymbolQueryInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~SymbolQueryInterface() {}
|
SymbolQueryInterface() = default;
|
||||||
|
SymbolQueryInterface(const SymbolQueryInterface &) = delete;
|
||||||
|
SymbolQueryInterface &operator=(const SymbolQueryInterface &) = delete;
|
||||||
|
|
||||||
virtual SourceLocations locationsAt(ClangBackEnd::FilePathId filePathId,
|
virtual SourceLocations locationsAt(ClangBackEnd::FilePathId filePathId,
|
||||||
int line,
|
int line,
|
||||||
int utf8Column) const = 0;
|
int utf8Column) const = 0;
|
||||||
@@ -57,6 +60,9 @@ public:
|
|||||||
virtual Symbols symbolsContaining(SymbolType symbolType,
|
virtual Symbols symbolsContaining(SymbolType symbolType,
|
||||||
Utils::SmallStringView regularExpression) const = 0;
|
Utils::SmallStringView regularExpression) const = 0;
|
||||||
virtual Functions functionsContaining(Utils::SmallStringView regularExpression) const = 0;
|
virtual Functions functionsContaining(Utils::SmallStringView regularExpression) const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~SymbolQueryInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangRefactoring
|
} // namespace ClangRefactoring
|
||||||
|
|||||||
@@ -2,11 +2,7 @@ INCLUDEPATH += $$PWD
|
|||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/pchmanagerserver.cpp \
|
$$PWD/pchmanagerserver.cpp \
|
||||||
$$PWD/projectparts.cpp \
|
$$PWD/projectparts.cpp
|
||||||
$$PWD/pchcreatorinterface.cpp \
|
|
||||||
$$PWD/projectpartsinterface.cpp \
|
|
||||||
$$PWD/pchgeneratornotifierinterface.cpp \
|
|
||||||
$$PWD/pchgeneratorinterface.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/pchmanagerserver.h \
|
$$PWD/pchmanagerserver.h \
|
||||||
|
|||||||
@@ -32,10 +32,16 @@ namespace ClangBackEnd {
|
|||||||
class Environment
|
class Environment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Environment() = default;
|
Environment() = default;
|
||||||
|
Environment(const Environment &) = delete;
|
||||||
|
Environment &operator=(const Environment &) = delete;
|
||||||
|
|
||||||
virtual QString pchBuildDirectory() const = 0;
|
virtual QString pchBuildDirectory() const = 0;
|
||||||
virtual QString clangCompilerPath() const = 0;
|
virtual QString clangCompilerPath() const = 0;
|
||||||
virtual uint hardwareConcurrency() const = 0;
|
virtual uint hardwareConcurrency() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~Environment() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "pchcreatorinterface.h"
|
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
|
||||||
|
|
||||||
PchCreatorInterface::~PchCreatorInterface()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
|
||||||
@@ -36,11 +36,16 @@ namespace ClangBackEnd {
|
|||||||
class PchCreatorInterface
|
class PchCreatorInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~PchCreatorInterface();
|
PchCreatorInterface() = default;
|
||||||
|
PchCreatorInterface(const PchCreatorInterface &) = delete;
|
||||||
|
PchCreatorInterface &operator=(const PchCreatorInterface &) = delete;
|
||||||
|
|
||||||
virtual void generatePchs(V2::ProjectPartContainers &&projectsParts) = 0;
|
virtual void generatePchs(V2::ProjectPartContainers &&projectsParts) = 0;
|
||||||
virtual void setGeneratedFiles(V2::FileContainers &&generatedFiles) = 0;
|
virtual void setGeneratedFiles(V2::FileContainers &&generatedFiles) = 0;
|
||||||
virtual std::vector<IdPaths> takeProjectsIncludes() = 0;
|
virtual std::vector<IdPaths> takeProjectsIncludes() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PchCreatorInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "pchgeneratorinterface.h"
|
|
||||||
|
|
||||||
ClangBackEnd::PchGeneratorInterface::~PchGeneratorInterface()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -34,11 +34,15 @@ class ProjectPartPch;
|
|||||||
class PchGeneratorInterface
|
class PchGeneratorInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~PchGeneratorInterface();
|
PchGeneratorInterface() = default;
|
||||||
|
PchGeneratorInterface(const PchGeneratorInterface &) = delete;
|
||||||
|
PchGeneratorInterface &operator=(const PchGeneratorInterface &) = delete;
|
||||||
|
|
||||||
virtual void startTask(Utils::SmallStringVector &&compilerArguments,
|
virtual void startTask(Utils::SmallStringVector &&compilerArguments,
|
||||||
ProjectPartPch &&projectPartPch) = 0;
|
ProjectPartPch &&projectPartPch) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PchGeneratorInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "pchgeneratornotifierinterface.h"
|
|
||||||
|
|
||||||
#include <ostream>
|
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
|
||||||
|
|
||||||
PchGeneratorNotifierInterface::~PchGeneratorNotifierInterface()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, TaskFinishStatus status)
|
|
||||||
{
|
|
||||||
enum class TaskFinishStatus
|
|
||||||
{
|
|
||||||
Successfully,
|
|
||||||
Unsuccessfully
|
|
||||||
};
|
|
||||||
|
|
||||||
if (status == ClangBackEnd::TaskFinishStatus::Successfully)
|
|
||||||
out << "Successfully";
|
|
||||||
else
|
|
||||||
out << "Unsuccessfully";
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
|
||||||
@@ -40,11 +40,14 @@ enum class TaskFinishStatus
|
|||||||
class PchGeneratorNotifierInterface
|
class PchGeneratorNotifierInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~PchGeneratorNotifierInterface();
|
PchGeneratorNotifierInterface() = default;
|
||||||
|
PchGeneratorNotifierInterface(const PchGeneratorNotifierInterface &) = delete;
|
||||||
|
PchGeneratorNotifierInterface &operator=(const PchGeneratorNotifierInterface &) = delete;
|
||||||
|
|
||||||
virtual void taskFinished(TaskFinishStatus status, const ProjectPartPch &projectPartPch) = 0;
|
virtual void taskFinished(TaskFinishStatus status, const ProjectPartPch &projectPartPch) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~PchGeneratorNotifierInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, TaskFinishStatus status);
|
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "projectpartsinterface.h"
|
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
|
||||||
|
|
||||||
ProjectPartsInterface::~ProjectPartsInterface()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
|
||||||
@@ -32,11 +32,16 @@ namespace ClangBackEnd {
|
|||||||
class ProjectPartsInterface
|
class ProjectPartsInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~ProjectPartsInterface();
|
ProjectPartsInterface() = default;
|
||||||
|
ProjectPartsInterface(const ProjectPartsInterface &) = delete;
|
||||||
|
ProjectPartsInterface &operator=(const ProjectPartsInterface &) = delete;
|
||||||
|
|
||||||
virtual V2::ProjectPartContainers update(V2::ProjectPartContainers &&projectsParts) = 0;
|
virtual V2::ProjectPartContainers update(V2::ProjectPartContainers &&projectsParts) = 0;
|
||||||
virtual void remove(const Utils::SmallStringVector &projectPartIds) = 0;
|
virtual void remove(const Utils::SmallStringVector &projectPartIds) = 0;
|
||||||
virtual V2::ProjectPartContainers projects(const Utils::SmallStringVector &projectPartIds) const = 0;
|
virtual V2::ProjectPartContainers projects(const Utils::SmallStringVector &projectPartIds) const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~ProjectPartsInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -67,6 +67,5 @@ SOURCES += \
|
|||||||
$$PWD/sourcerangefilter.cpp \
|
$$PWD/sourcerangefilter.cpp \
|
||||||
$$PWD/symbolindexer.cpp \
|
$$PWD/symbolindexer.cpp \
|
||||||
$$PWD/symbolentry.cpp \
|
$$PWD/symbolentry.cpp \
|
||||||
$$PWD/symbolstorageinterface.cpp \
|
|
||||||
$$PWD/projectpartartefact.cpp \
|
$$PWD/projectpartartefact.cpp \
|
||||||
$$PWD/filestatuscache.cpp
|
$$PWD/filestatuscache.cpp
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public:
|
|||||||
using size_type = Internal::FileStatusCacheEntries::size_type;
|
using size_type = Internal::FileStatusCacheEntries::size_type;
|
||||||
|
|
||||||
FileStatusCache(FilePathCachingInterface &filePathCache);
|
FileStatusCache(FilePathCachingInterface &filePathCache);
|
||||||
|
FileStatusCache &operator=(const FileStatusCache &) = delete;
|
||||||
|
FileStatusCache(const FileStatusCache &) = delete;
|
||||||
|
|
||||||
long long lastModifiedTime(ClangBackEnd::FilePathId filePathId) const;
|
long long lastModifiedTime(ClangBackEnd::FilePathId filePathId) const;
|
||||||
void update(ClangBackEnd::FilePathId filePathId);
|
void update(ClangBackEnd::FilePathId filePathId);
|
||||||
|
|||||||
@@ -27,4 +27,9 @@
|
|||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
|
void SymbolIndexing::updateProjectParts(V2::ProjectPartContainers &&projectParts, V2::FileContainers &&generatedFiles)
|
||||||
|
{
|
||||||
|
m_indexer.updateProjectParts(std::move(projectParts), std::move(generatedFiles));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateProjectParts(V2::ProjectPartContainers &&projectParts,
|
void updateProjectParts(V2::ProjectPartContainers &&projectParts,
|
||||||
V2::FileContainers &&generatedFiles)
|
V2::FileContainers &&generatedFiles);
|
||||||
{
|
|
||||||
m_indexer.updateProjectParts(std::move(projectParts), std::move(generatedFiles));
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FilePathCachingInterface &m_filePathCache;
|
FilePathCachingInterface &m_filePathCache;
|
||||||
|
|||||||
@@ -33,8 +33,15 @@ namespace ClangBackEnd {
|
|||||||
class SymbolIndexingInterface
|
class SymbolIndexingInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
SymbolIndexingInterface() = default;
|
||||||
|
SymbolIndexingInterface(const SymbolIndexingInterface&) = delete;
|
||||||
|
SymbolIndexingInterface &operator=(const SymbolIndexingInterface&) = delete;
|
||||||
|
|
||||||
virtual void updateProjectParts(V2::ProjectPartContainers &&projectParts,
|
virtual void updateProjectParts(V2::ProjectPartContainers &&projectParts,
|
||||||
V2::FileContainers &&generatedFiles) = 0;
|
V2::FileContainers &&generatedFiles) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~SymbolIndexingInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ namespace ClangBackEnd {
|
|||||||
class SymbolsCollectorInterface
|
class SymbolsCollectorInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
SymbolsCollectorInterface() = default;
|
||||||
|
SymbolsCollectorInterface(const SymbolsCollectorInterface &) = delete;
|
||||||
|
SymbolsCollectorInterface &operator=(const SymbolsCollectorInterface &) = delete;
|
||||||
|
|
||||||
virtual void addFiles(const FilePathIds &filePathIds,
|
virtual void addFiles(const FilePathIds &filePathIds,
|
||||||
const Utils::SmallStringVector &arguments) = 0;
|
const Utils::SmallStringVector &arguments) = 0;
|
||||||
|
|
||||||
@@ -58,6 +62,9 @@ public:
|
|||||||
virtual const UsedMacros &usedMacros() const = 0;
|
virtual const UsedMacros &usedMacros() const = 0;
|
||||||
virtual const FileStatuses &fileStatuses() const = 0;
|
virtual const FileStatuses &fileStatuses() const = 0;
|
||||||
virtual const SourceDependencies &sourceDependencies() const = 0;
|
virtual const SourceDependencies &sourceDependencies() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~SymbolsCollectorInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ class SymbolStorageInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SymbolStorageInterface() = default;
|
SymbolStorageInterface() = default;
|
||||||
virtual ~SymbolStorageInterface();
|
|
||||||
SymbolStorageInterface(const SymbolStorageInterface &) = delete;
|
SymbolStorageInterface(const SymbolStorageInterface &) = delete;
|
||||||
SymbolStorageInterface &operator=(const SymbolStorageInterface &) = delete;
|
SymbolStorageInterface &operator=(const SymbolStorageInterface &) = delete;
|
||||||
|
|
||||||
@@ -65,6 +64,9 @@ public:
|
|||||||
virtual Utils::optional<ProjectPartArtefact> fetchProjectPartArtefact(Utils::SmallStringView projectPartName) const = 0;
|
virtual Utils::optional<ProjectPartArtefact> fetchProjectPartArtefact(Utils::SmallStringView projectPartName) const = 0;
|
||||||
virtual long long fetchLowestLastModifiedTime(FilePathId sourceId) const = 0;
|
virtual long long fetchLowestLastModifiedTime(FilePathId sourceId) const = 0;
|
||||||
virtual Utils::optional<ProjectPartPch> fetchPrecompiledHeader(int projectPartId) const = 0;
|
virtual Utils::optional<ProjectPartPch> fetchPrecompiledHeader(int projectPartId) const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~SymbolStorageInterface() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user