WPILibC++  unspecified
INetworkConnection.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2017. 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_INETWORKCONNECTION_H_
9 #define NT_INETWORKCONNECTION_H_
10 
11 #include <memory>
12 
13 #include "Message.h"
14 #include "ntcore_cpp.h"
15 
16 namespace nt {
17 
19  public:
20  enum State { kCreated, kInit, kHandshake, kSynchronized, kActive, kDead };
21 
22  INetworkConnection() = default;
23  INetworkConnection(const INetworkConnection&) = delete;
24  INetworkConnection& operator=(const INetworkConnection&) = delete;
25  virtual ~INetworkConnection() = default;
26 
27  virtual ConnectionInfo info() const = 0;
28 
29  virtual void QueueOutgoing(std::shared_ptr<Message> msg) = 0;
30  virtual void PostOutgoing(bool keep_alive) = 0;
31 
32  virtual unsigned int proto_rev() const = 0;
33  virtual void set_proto_rev(unsigned int proto_rev) = 0;
34 
35  virtual State state() const = 0;
36  virtual void set_state(State state) = 0;
37 };
38 
39 } // namespace nt
40 
41 #endif // NT_INETWORKCONNECTION_H_
NetworkTables Connection Information.
Definition: ntcore_cpp.h:57
Definition: IEntryNotifier.h:15
Definition: INetworkConnection.h:18