Communication: Avoid MessageFilter type punning in waitForMessageSync

This commit is contained in:
Paul Hollinsky
2021-12-02 15:00:13 -05:00
parent 78747aa899
commit f8b5710a6c
7 changed files with 34 additions and 21 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ public:
int addMessageCallback(const MessageCallback& cb);
bool removeMessageCallback(int id);
std::shared_ptr<Message> waitForMessageSync(
MessageFilter f = MessageFilter(),
const std::shared_ptr<MessageFilter>& f = {},
std::chrono::milliseconds timeout = std::chrono::milliseconds(50)) {
return waitForMessageSync([](){ return true; }, f, timeout);
}
@@ -68,7 +68,7 @@ public:
// Return false to bail early, in case your initial command failed.
std::shared_ptr<Message> waitForMessageSync(
std::function<bool(void)> onceWaitingDo,
MessageFilter f = MessageFilter(),
const std::shared_ptr<MessageFilter>& f = {},
std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
std::function<std::unique_ptr<Packetizer>()> makeConfiguredPacketizer;