WPILibC++  unspecified
IRpcServer.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_IRPCSERVER_H_
9 #define NT_IRPCSERVER_H_
10 
11 #include <memory>
12 
13 #include "Message.h"
14 #include "ntcore_cpp.h"
15 
16 namespace nt {
17 
18 class IRpcServer {
19  public:
20  typedef std::function<void(StringRef result)> SendResponseFunc;
21 
22  IRpcServer() = default;
23  IRpcServer(const IRpcServer&) = delete;
24  IRpcServer& operator=(const IRpcServer&) = delete;
25  virtual ~IRpcServer() = default;
26 
27  virtual void RemoveRpc(unsigned int rpc_uid) = 0;
28 
29  virtual void ProcessRpc(unsigned int local_id, unsigned int call_uid,
30  StringRef name, StringRef params,
31  const ConnectionInfo& conn,
32  SendResponseFunc send_response,
33  unsigned int rpc_uid) = 0;
34 };
35 
36 } // namespace nt
37 
38 #endif // NT_IRPCSERVER_H_
NetworkTables Connection Information.
Definition: ntcore_cpp.h:57
Definition: IEntryNotifier.h:15
Definition: IRpcServer.h:18
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42