WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
DsClient.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2016. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef NT_DSCLIENT_H_
9 #define NT_DSCLIENT_H_
10 
11 #include "support/atomic_static.h"
12 #include "support/SafeThread.h"
13 
14 namespace nt {
15 
16 class DsClient {
17  public:
18  static DsClient& GetInstance() {
19  ATOMIC_STATIC(DsClient, instance);
20  return instance;
21  }
22  ~DsClient() = default;
23 
24  void Start(unsigned int port);
25  void Stop();
26 
27  private:
28  DsClient() = default;
29 
30  class Thread;
31  wpi::SafeThreadOwner<Thread> m_owner;
32 
33  ATOMIC_STATIC_DECL(DsClient)
34 };
35 
36 } // namespace nt
37 
38 #endif // NT_DSCLIENT_H_
Definition: DsClient.h:16
Definition: DsClient.cpp:22