mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[cscore] Fix Java direct callback notifications (#3631)
These relied on the OnStart and OnExit callbacks which were not present in the wpiutil common CallbackManager code. Add support for these and fix up other use cases. Also fixes notifications to correctly filter on event kind. This fixes a breakage caused by #3133.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#ifndef NTCORE_CONNECTIONNOTIFIER_H_
|
||||
#define NTCORE_CONNECTIONNOTIFIER_H_
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <wpi/CallbackManager.h>
|
||||
|
||||
#include "Handle.h"
|
||||
@@ -19,7 +21,9 @@ class ConnectionNotifierThread
|
||||
: public wpi::CallbackThread<ConnectionNotifierThread,
|
||||
ConnectionNotification> {
|
||||
public:
|
||||
explicit ConnectionNotifierThread(int inst) : m_inst(inst) {}
|
||||
ConnectionNotifierThread(std::function<void()> on_start,
|
||||
std::function<void()> on_exit, int inst)
|
||||
: CallbackThread(std::move(on_start), std::move(on_exit)), m_inst(inst) {}
|
||||
|
||||
bool Matches(const ListenerData& /*listener*/,
|
||||
const ConnectionNotification& /*data*/) {
|
||||
|
||||
Reference in New Issue
Block a user