mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
NetworkListener: use Pimpl idiom (#1405)
This enables different platforms to use very different implementations.
This commit is contained in:
@@ -7,31 +7,14 @@
|
||||
|
||||
#include "NetworkListener.h"
|
||||
|
||||
#include "Log.h"
|
||||
#include "Notifier.h"
|
||||
|
||||
using namespace cs;
|
||||
|
||||
class NetworkListener::Thread : public wpi::SafeThread {
|
||||
public:
|
||||
void Main();
|
||||
};
|
||||
class NetworkListener::Impl {};
|
||||
|
||||
NetworkListener::~NetworkListener() { Stop(); }
|
||||
NetworkListener::NetworkListener(wpi::Logger& logger, Notifier& notifier) {}
|
||||
|
||||
void NetworkListener::Start() {
|
||||
auto thr = m_owner.GetThread();
|
||||
if (!thr) m_owner.Start();
|
||||
}
|
||||
NetworkListener::~NetworkListener() {}
|
||||
|
||||
void NetworkListener::Stop() {
|
||||
// Wake up thread
|
||||
if (auto thr = m_owner.GetThread()) {
|
||||
thr->m_active = false;
|
||||
}
|
||||
m_owner.Stop();
|
||||
}
|
||||
void NetworkListener::Start() {}
|
||||
|
||||
void NetworkListener::Thread::Main() {
|
||||
// TODO
|
||||
}
|
||||
void NetworkListener::Stop() {}
|
||||
|
||||
Reference in New Issue
Block a user