本文整理汇总了C++中MessagePtr::equals方法的典型用法代码示例。如果您正苦于以下问题:C++ MessagePtr::equals方法的具体用法?C++ MessagePtr::equals怎么用?C++ MessagePtr::equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessagePtr
的用法示例。
在下文中一共展示了MessagePtr::equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleReceivedMessage
LocalFork::MessageAction LocalFork::handleReceivedMessage(MessagePtr msg, const AffectedArea &area)
{
// No local fork: nothing to do. It is possible that we get a message from ourselves
// that is not in the local fork, but this is not an error. It could happen when
// playing back recordings, for example.
if(_messages.isEmpty())
return CONCURRENT;
// Check if this is our own message that has finished its roundtrip
if(msg->contextId() == _messages.first()->contextId()) {
if(msg.equals(_messages.first())) {
_messages.removeFirst();
_areas.removeFirst();
return ALREADYDONE;
} else {
// Unusual, but not an error. This can happen when the layer is locked while drawing
// or when an operator performs some function on behalf the user.
qWarning("local fork out of sync: discarding...");
clear();
return ROLLBACK;
}
}
// OK, so this is another user's message. Check if it is concurrent
for(const AffectedArea &a : _areas) {
if(!area.isConcurrentWith(a)) {
return ROLLBACK;
}
}
return CONCURRENT;
}