Now you can download a copy of these docs so you can use them offline! Download now
ServerConnectionAdapter.h
1 /*
2  * ServerConnectionAdapter.h
3  *
4  * Created on: Sep 26, 2012
5  * Author: Mitchell Wills
6  */
7 
8 #ifndef SERVERCONNECTIONADAPTER_H_
9 #define SERVERCONNECTIONADAPTER_H_
10 
12 
13 #include "networktables2/connection/ConnectionMonitorThread.h"
14 #include "networktables2/NetworkTableEntry.h"
15 #include "networktables2/connection/ConnectionAdapter.h"
16 #include "networktables2/stream/IOStream.h"
17 #include "networktables2/IncomingEntryReceiver.h"
18 #include "networktables2/FlushableOutgoingEntryReceiver.h"
19 #include "networktables2/server/ServerNetworkTableEntryStore.h"
20 #include "networktables2/server/ServerAdapterManager.h"
21 #include "networktables2/server/ServerConnectionState.h"
22 #include "networktables2/thread/NTThread.h"
23 #include "networktables2/thread/NTThreadManager.h"
24 
25 
26 
34 private:
35  ServerNetworkTableEntryStore& entryStore;
36  IncomingEntryReceiver& transactionReceiver;
37  ServerAdapterManager& adapterListener;
38 public:
43 private:
44  NTThread* readThread;
45  ConnectionMonitorThread monitorThread;
46 private:
47 
48  ServerConnectionState* connectionState;
49 
50  void gotoState(ServerConnectionState* newState);
51  bool m_IsAdapterListenerClosed;
52 public:
63  ServerConnectionAdapter(IOStream* stream, ServerNetworkTableEntryStore& entryStore, IncomingEntryReceiver& transactionReceiver, ServerAdapterManager& adapterListener, NetworkTableEntryTypeManager& typeManager, NTThreadManager& threadManager);
64  virtual ~ServerConnectionAdapter();
65 
69  void shutdown(bool closeStream);
70 
71  void offerOutgoingAssignment(NetworkTableEntry* entry);
72 
73  void offerOutgoingUpdate(NetworkTableEntry* entry);
74 
75 
76  void flush();
77 
82 
83  void ensureAlive();
84 
85  //return true once the close has been issued
86  bool IsAdapterListenerClosed() const {return m_IsAdapterListenerClosed;}
87  ConnectionAdapter &AsConnectionAdapter() {return *this;}
88 protected: //from ConnectionAdapter
89 
90  bool keepAlive();
92  void ioException(IOException& e);
93  void clientHello(ProtocolVersion protocolRevision);
94  void protocolVersionUnsupported(ProtocolVersion protocolRevision);
95  void serverHelloComplete();
96  void offerIncomingAssignment(NetworkTableEntry* entry);
97  void offerIncomingUpdate(NetworkTableEntry* entry, SequenceNumber sequenceNumber, EntryValue value);
98  NetworkTableEntry* GetEntry(EntryId id);
99 };
100 
101 
102 #endif /* SERVERCONNECTIONADAPTER_H_ */
void ioException(IOException &e)
NetworkTableConnection connection
ServerConnectionState * getConnectionState()
ServerConnectionAdapter(IOStream *stream, ServerNetworkTableEntryStore &entryStore, IncomingEntryReceiver &transactionReceiver, ServerAdapterManager &adapterListener, NetworkTableEntryTypeManager &typeManager, NTThreadManager &threadManager)
void badMessage(BadMessageException &e)
void shutdown(bool closeStream)
Definition: ITable.h:13

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6