From 9617520e52e8abdfd830c9237161c5aedb906edc Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 19 Jul 2016 13:49:53 +0200 Subject: [PATCH] Clang: Inline DocumentAnnotationsChangedMessage Change-Id: Ib2f16cb48bf3413006a1eaebcabc7d6cca696970 Reviewed-by: Tim Jenssen --- .../documentannotationschangedmessage.cpp | 69 ++---------------- .../documentannotationschangedmessage.h | 70 +++++++++++++++---- 2 files changed, 59 insertions(+), 80 deletions(-) diff --git a/src/libs/clangbackendipc/documentannotationschangedmessage.cpp b/src/libs/clangbackendipc/documentannotationschangedmessage.cpp index 47125c00c7a..b8b4b36601c 100644 --- a/src/libs/clangbackendipc/documentannotationschangedmessage.cpp +++ b/src/libs/clangbackendipc/documentannotationschangedmessage.cpp @@ -32,74 +32,13 @@ namespace ClangBackEnd { -DocumentAnnotationsChangedMessage::DocumentAnnotationsChangedMessage( - const FileContainer &file, - const QVector &diagnostics, - const QVector &highlightingMarks, - const QVector &skippedPreprocessorRanges) - : fileContainer_(file), - diagnostics_(diagnostics), - highlightingMarks_(highlightingMarks), - skippedPreprocessorRanges_(skippedPreprocessorRanges) -{ -} - -const FileContainer &DocumentAnnotationsChangedMessage::fileContainer() const -{ - return fileContainer_; -} - -const QVector &DocumentAnnotationsChangedMessage::diagnostics() const -{ - return diagnostics_; -} - -const QVector &DocumentAnnotationsChangedMessage::highlightingMarks() const -{ - return highlightingMarks_; -} - -const QVector &DocumentAnnotationsChangedMessage::skippedPreprocessorRanges() const -{ - return skippedPreprocessorRanges_; -} - -QDataStream &operator<<(QDataStream &out, const DocumentAnnotationsChangedMessage &message) -{ - out << message.fileContainer_; - out << message.diagnostics_; - out << message.highlightingMarks_; - out << message.skippedPreprocessorRanges_; - - return out; -} - -QDataStream &operator>>(QDataStream &in, DocumentAnnotationsChangedMessage &message) -{ - in >> message.fileContainer_; - in >> message.diagnostics_; - in >> message.highlightingMarks_; - in >> message.skippedPreprocessorRanges_; - - return in; -} - -bool operator==(const DocumentAnnotationsChangedMessage &first, - const DocumentAnnotationsChangedMessage &second) -{ - return first.fileContainer_ == second.fileContainer_ - && first.diagnostics_ == second.diagnostics_ - && first.highlightingMarks_ == second.highlightingMarks_ - && first.skippedPreprocessorRanges_ == second.skippedPreprocessorRanges_; -} - QDebug operator<<(QDebug debug, const DocumentAnnotationsChangedMessage &message) { debug.nospace() << "DocumentAnnotationsChangedMessage(" - << message.fileContainer_ - << ", " << message.diagnostics_.size() - << ", " << message.highlightingMarks_.size() - << ", " << message.skippedPreprocessorRanges_.size() + << message.fileContainer() + << ", " << message.diagnostics().size() + << ", " << message.highlightingMarks().size() + << ", " << message.skippedPreprocessorRanges().size() << ")"; return debug; diff --git a/src/libs/clangbackendipc/documentannotationschangedmessage.h b/src/libs/clangbackendipc/documentannotationschangedmessage.h index 291234b954d..556794385d8 100644 --- a/src/libs/clangbackendipc/documentannotationschangedmessage.h +++ b/src/libs/clangbackendipc/documentannotationschangedmessage.h @@ -37,23 +37,67 @@ namespace ClangBackEnd { class CMBIPC_EXPORT DocumentAnnotationsChangedMessage { - friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const DocumentAnnotationsChangedMessage &message); - friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, DocumentAnnotationsChangedMessage &message); - friend CMBIPC_EXPORT bool operator==(const DocumentAnnotationsChangedMessage &first, const DocumentAnnotationsChangedMessage &second); - friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const DocumentAnnotationsChangedMessage &message); - friend void PrintTo(const DocumentAnnotationsChangedMessage &message, ::std::ostream* os); - public: DocumentAnnotationsChangedMessage() = default; DocumentAnnotationsChangedMessage(const FileContainer &fileContainer, const QVector &diagnostics, const QVector &highlightingMarks, - const QVector &skippedPreprocessorRanges); + const QVector &skippedPreprocessorRanges) + : fileContainer_(fileContainer), + diagnostics_(diagnostics), + highlightingMarks_(highlightingMarks), + skippedPreprocessorRanges_(skippedPreprocessorRanges) + { + } - const FileContainer &fileContainer() const; - const QVector &diagnostics() const; - const QVector &highlightingMarks() const; - const QVector &skippedPreprocessorRanges() const; + const FileContainer &fileContainer() const + { + return fileContainer_; + } + + const QVector &diagnostics() const + { + return diagnostics_; + } + + const QVector &highlightingMarks() const + { + return highlightingMarks_; + } + + const QVector &skippedPreprocessorRanges() const + { + return skippedPreprocessorRanges_; + } + + friend QDataStream &operator<<(QDataStream &out, const DocumentAnnotationsChangedMessage &message) + { + out << message.fileContainer_; + out << message.diagnostics_; + out << message.highlightingMarks_; + out << message.skippedPreprocessorRanges_; + + return out; + } + + friend QDataStream &operator>>(QDataStream &in, DocumentAnnotationsChangedMessage &message) + { + in >> message.fileContainer_; + in >> message.diagnostics_; + in >> message.highlightingMarks_; + in >> message.skippedPreprocessorRanges_; + + return in; + } + + friend bool operator==(const DocumentAnnotationsChangedMessage &first, + const DocumentAnnotationsChangedMessage &second) + { + return first.fileContainer_ == second.fileContainer_ + && first.diagnostics_ == second.diagnostics_ + && first.highlightingMarks_ == second.highlightingMarks_ + && first.skippedPreprocessorRanges_ == second.skippedPreprocessorRanges_; + } private: FileContainer fileContainer_; @@ -62,10 +106,6 @@ private: QVector skippedPreprocessorRanges_; }; -CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const DocumentAnnotationsChangedMessage &message); -CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, DocumentAnnotationsChangedMessage &message); -CMBIPC_EXPORT bool operator==(const DocumentAnnotationsChangedMessage &first, const DocumentAnnotationsChangedMessage &second); - CMBIPC_EXPORT QDebug operator<<(QDebug debug, const DocumentAnnotationsChangedMessage &message); void PrintTo(const DocumentAnnotationsChangedMessage &message, ::std::ostream* os);