NetworkListener: use Pimpl idiom (#1405)

This enables different platforms to use very different implementations.
This commit is contained in:
Peter Johnson
2018-11-02 13:14:06 -07:00
committed by GitHub
parent fb557f49ea
commit b6830638df
4 changed files with 41 additions and 60 deletions

View File

@@ -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