forked from qt-creator/qt-creator
Clang: Use MessageEnvelop instead of QVariant
QVariant has unwanted dependencies so we provided our own simpler solution. We want to support move only types and calling the copy constructor as you move the value in and outside. This copying is adding unwanted overhead too. Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -32,13 +32,12 @@
|
||||
|
||||
namespace ClangBackEnd {
|
||||
|
||||
EchoMessage::EchoMessage(const QVariant &message)
|
||||
EchoMessage::EchoMessage(const MessageEnvelop &message)
|
||||
: message_(message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const QVariant &EchoMessage::message() const
|
||||
const MessageEnvelop &EchoMessage::message() const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
@@ -62,24 +61,14 @@ bool operator==(const EchoMessage &first, const EchoMessage &second)
|
||||
return first.message_ == second.message_;
|
||||
}
|
||||
|
||||
bool operator<(const EchoMessage &first, const EchoMessage &second)
|
||||
QDebug operator<<(QDebug debug, const EchoMessage &)
|
||||
{
|
||||
return first.message_ < second.message_;
|
||||
return debug.nospace() << "EchoMessage()";
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const EchoMessage &message)
|
||||
void PrintTo(const EchoMessage &, ::std::ostream* os)
|
||||
{
|
||||
return debug.nospace() << "EchoMessage(" << message.message() << ")";
|
||||
}
|
||||
|
||||
void PrintTo(const EchoMessage &message, ::std::ostream* os)
|
||||
{
|
||||
QString output;
|
||||
QDebug debug(&output);
|
||||
|
||||
debug << message;
|
||||
|
||||
*os << output.toUtf8().constData();
|
||||
*os << "EchoMessage()";
|
||||
}
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
Reference in New Issue
Block a user