mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
NetworkListener: use Pimpl idiom (#1405)
This enables different platforms to use very different implementations.
This commit is contained in:
@@ -8,8 +8,9 @@
|
||||
#ifndef CSCORE_NETWORKLISTENER_H_
|
||||
#define CSCORE_NETWORKLISTENER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SafeThread.h>
|
||||
|
||||
namespace cs {
|
||||
|
||||
@@ -17,19 +18,15 @@ class Notifier;
|
||||
|
||||
class NetworkListener {
|
||||
public:
|
||||
NetworkListener(wpi::Logger& logger, Notifier& notifier)
|
||||
: m_logger(logger), m_notifier(notifier) {}
|
||||
NetworkListener(wpi::Logger& logger, Notifier& notifier);
|
||||
~NetworkListener();
|
||||
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
wpi::Logger& m_logger;
|
||||
Notifier& m_notifier;
|
||||
|
||||
class Thread;
|
||||
wpi::SafeThreadOwner<Thread> m_owner;
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> m_impl;
|
||||
};
|
||||
|
||||
} // namespace cs
|
||||
|
||||
Reference in New Issue
Block a user