mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Communication: Avoid MessageFilter type punning in waitForMessageSync
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
// We still guarantee it's a Main51Message if it matches because of the dynamic_pointer_cast below
|
||||
Main51MessageFilter(Command command) : command(command) { includeInternalInAny = true; }
|
||||
|
||||
bool match(const std::shared_ptr<Message>& message) const {
|
||||
bool match(const std::shared_ptr<Message>& message) const override {
|
||||
if(!MessageFilter::match(message)) {
|
||||
//std::cout << "message filter did not match base for " << message->network << std::endl;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user