From 32d8e4a74fbac1b74dd7dc0a0dd357dda6de3556 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 19 Jul 2016 11:49:59 +0200 Subject: [PATCH] Clang: Inline RegisterTranslationUnitForEditorMessage Change-Id: I07b28a757dfc019a46617433491756385d646d96 Reviewed-by: Tim Jenssen --- ...gistertranslationunitsforeditormessage.cpp | 49 --------------- ...registertranslationunitsforeditormessage.h | 61 ++++++++++++++----- 2 files changed, 47 insertions(+), 63 deletions(-) diff --git a/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.cpp b/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.cpp index 2eadad185be..2f1b7ac65d2 100644 --- a/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.cpp +++ b/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.cpp @@ -25,61 +25,12 @@ #include "cmbregistertranslationunitsforeditormessage.h" -#include #include #include namespace ClangBackEnd { -RegisterTranslationUnitForEditorMessage::RegisterTranslationUnitForEditorMessage(const QVector &fileContainers, - const Utf8String ¤tEditorFilePath, - const Utf8StringVector &visibleEditorFilePaths) - : fileContainers_(fileContainers), - currentEditorFilePath_(currentEditorFilePath), - visibleEditorFilePaths_(visibleEditorFilePaths) -{ -} - -const QVector &RegisterTranslationUnitForEditorMessage::fileContainers() const -{ - return fileContainers_; -} - -const Utf8String &RegisterTranslationUnitForEditorMessage::currentEditorFilePath() const -{ - return currentEditorFilePath_; -} - -const Utf8StringVector &RegisterTranslationUnitForEditorMessage::visibleEditorFilePaths() const -{ - return visibleEditorFilePaths_; -} - -QDataStream &operator<<(QDataStream &out, const RegisterTranslationUnitForEditorMessage &message) -{ - out << message.fileContainers_; - out << message.currentEditorFilePath_; - out << message.visibleEditorFilePaths_; - return out; -} - -QDataStream &operator>>(QDataStream &in, RegisterTranslationUnitForEditorMessage &message) -{ - in >> message.fileContainers_; - in >> message.currentEditorFilePath_; - in >> message.visibleEditorFilePaths_; - - return in; -} - -bool operator==(const RegisterTranslationUnitForEditorMessage &first, const RegisterTranslationUnitForEditorMessage &second) -{ - return first.fileContainers_ == second.fileContainers_ - && first.currentEditorFilePath_ == second.currentEditorFilePath_ - && first.visibleEditorFilePaths_ == second.visibleEditorFilePaths_; -} - QDebug operator<<(QDebug debug, const RegisterTranslationUnitForEditorMessage &message) { debug.nospace() << "RegisterTranslationUnitForEditorMessage("; diff --git a/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h b/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h index c2956bcd1cb..374acf600da 100644 --- a/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h +++ b/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h @@ -27,38 +27,71 @@ #include "filecontainer.h" +#include #include namespace ClangBackEnd { -class CMBIPC_EXPORT RegisterTranslationUnitForEditorMessage +class RegisterTranslationUnitForEditorMessage { - friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const RegisterTranslationUnitForEditorMessage &message); - friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, RegisterTranslationUnitForEditorMessage &message); - friend CMBIPC_EXPORT bool operator==(const RegisterTranslationUnitForEditorMessage &first, const RegisterTranslationUnitForEditorMessage &second); - friend void PrintTo(const RegisterTranslationUnitForEditorMessage &message, ::std::ostream* os); public: RegisterTranslationUnitForEditorMessage() = default; RegisterTranslationUnitForEditorMessage(const QVector &fileContainers, const Utf8String ¤tEditorFilePath, - const Utf8StringVector &visibleEditorFilePaths); + const Utf8StringVector &visibleEditorFilePaths) + : fileContainers_(fileContainers), + currentEditorFilePath_(currentEditorFilePath), + visibleEditorFilePaths_(visibleEditorFilePaths) + { + } - const QVector &fileContainers() const; - const Utf8String ¤tEditorFilePath() const; - const Utf8StringVector &visibleEditorFilePaths() const; + const QVector &fileContainers() const + { + return fileContainers_; + } + const Utf8String ¤tEditorFilePath() const + { + return currentEditorFilePath_; + } + + const Utf8StringVector &visibleEditorFilePaths() const + { + return visibleEditorFilePaths_; + } + + friend QDataStream &operator<<(QDataStream &out, const RegisterTranslationUnitForEditorMessage &message) + { + out << message.fileContainers_; + out << message.currentEditorFilePath_; + out << message.visibleEditorFilePaths_; + return out; + } + + friend QDataStream &operator>>(QDataStream &in, RegisterTranslationUnitForEditorMessage &message) + { + in >> message.fileContainers_; + in >> message.currentEditorFilePath_; + in >> message.visibleEditorFilePaths_; + + return in; + } + + friend bool operator==(const RegisterTranslationUnitForEditorMessage &first, const RegisterTranslationUnitForEditorMessage &second) + { + return first.fileContainers_ == second.fileContainers_ + && first.currentEditorFilePath_ == second.currentEditorFilePath_ + && first.visibleEditorFilePaths_ == second.visibleEditorFilePaths_; + } + + friend void PrintTo(const RegisterTranslationUnitForEditorMessage &message, ::std::ostream* os); private: QVector fileContainers_; Utf8String currentEditorFilePath_; Utf8StringVector visibleEditorFilePaths_; }; -CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const RegisterTranslationUnitForEditorMessage &message); -CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, RegisterTranslationUnitForEditorMessage &message); -CMBIPC_EXPORT bool operator==(const RegisterTranslationUnitForEditorMessage &first, const RegisterTranslationUnitForEditorMessage &second); - CMBIPC_EXPORT QDebug operator<<(QDebug debug, const RegisterTranslationUnitForEditorMessage &message); -void PrintTo(const RegisterTranslationUnitForEditorMessage &message, ::std::ostream* os); DECLARE_MESSAGE(RegisterTranslationUnitForEditorMessage); } // namespace ClangBackEnd