Clang: Inline DocumentAnnotationsChangedMessage

Change-Id: Ib2f16cb48bf3413006a1eaebcabc7d6cca696970
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-07-19 13:49:53 +02:00
committed by Tim Jenssen
parent ce45b4cf8b
commit 9617520e52
2 changed files with 59 additions and 80 deletions

View File

@@ -32,74 +32,13 @@
namespace ClangBackEnd {
DocumentAnnotationsChangedMessage::DocumentAnnotationsChangedMessage(
const FileContainer &file,
const QVector<DiagnosticContainer> &diagnostics,
const QVector<HighlightingMarkContainer> &highlightingMarks,
const QVector<SourceRangeContainer> &skippedPreprocessorRanges)
: fileContainer_(file),
diagnostics_(diagnostics),
highlightingMarks_(highlightingMarks),
skippedPreprocessorRanges_(skippedPreprocessorRanges)
{
}
const FileContainer &DocumentAnnotationsChangedMessage::fileContainer() const
{
return fileContainer_;
}
const QVector<DiagnosticContainer> &DocumentAnnotationsChangedMessage::diagnostics() const
{
return diagnostics_;
}
const QVector<HighlightingMarkContainer> &DocumentAnnotationsChangedMessage::highlightingMarks() const
{
return highlightingMarks_;
}
const QVector<SourceRangeContainer> &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;

View File

@@ -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<DiagnosticContainer> &diagnostics,
const QVector<HighlightingMarkContainer> &highlightingMarks,
const QVector<SourceRangeContainer> &skippedPreprocessorRanges);
const QVector<SourceRangeContainer> &skippedPreprocessorRanges)
: fileContainer_(fileContainer),
diagnostics_(diagnostics),
highlightingMarks_(highlightingMarks),
skippedPreprocessorRanges_(skippedPreprocessorRanges)
{
}
const FileContainer &fileContainer() const;
const QVector<DiagnosticContainer> &diagnostics() const;
const QVector<HighlightingMarkContainer> &highlightingMarks() const;
const QVector<SourceRangeContainer> &skippedPreprocessorRanges() const;
const FileContainer &fileContainer() const
{
return fileContainer_;
}
const QVector<DiagnosticContainer> &diagnostics() const
{
return diagnostics_;
}
const QVector<HighlightingMarkContainer> &highlightingMarks() const
{
return highlightingMarks_;
}
const QVector<SourceRangeContainer> &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<SourceRangeContainer> 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);