Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
networktables2
server
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
11
class
ServerConnectionAdapter
;
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
33
class
ServerConnectionAdapter
:
public
ConnectionAdapter
,
public
IncomingEntryReceiver
,
public
FlushableOutgoingEntryReceiver
{
34
private
:
35
ServerNetworkTableEntryStore
& entryStore;
36
IncomingEntryReceiver
& transactionReceiver;
37
ServerAdapterManager
& adapterListener;
38
public
:
42
NetworkTableConnection
connection
;
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
81
ServerConnectionState
*
getConnectionState
();
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();
91
void
badMessage
(
BadMessageException
& e);
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_ */
ServerConnectionAdapter
Definition:
ServerConnectionAdapter.h:33
ServerConnectionAdapter::ioException
void ioException(IOException &e)
Definition:
ServerConnectionAdapter.cpp:41
IncomingEntryReceiver
Definition:
IncomingEntryReceiver.h:14
NTThreadManager
Definition:
NTThreadManager.h:22
IOStream
Definition:
IOStream.h:13
ServerConnectionAdapter::connection
NetworkTableConnection connection
Definition:
ServerConnectionAdapter.h:42
ServerConnectionAdapter::getConnectionState
ServerConnectionState * getConnectionState()
Definition:
ServerConnectionAdapter.cpp:125
NetworkTableEntryTypeManager
Definition:
NetworkTableEntryTypeManager.h:15
BadMessageException
Definition:
BadMessageException.h:14
FlushableOutgoingEntryReceiver
Definition:
FlushableOutgoingEntryReceiver.h:15
ServerConnectionAdapter::ServerConnectionAdapter
ServerConnectionAdapter(IOStream *stream, ServerNetworkTableEntryStore &entryStore, IncomingEntryReceiver &transactionReceiver, ServerAdapterManager &adapterListener, NetworkTableEntryTypeManager &typeManager, NTThreadManager &threadManager)
Definition:
ServerConnectionAdapter.cpp:20
IOException
Definition:
IOException.h:16
ServerNetworkTableEntryStore
Definition:
ServerNetworkTableEntryStore.h:27
ConnectionMonitorThread
Definition:
ConnectionMonitorThread.h:26
NTThread
Definition:
NTThread.h:16
NetworkTableEntry
Definition:
NetworkTableEntry.h:30
ConnectionAdapter
Definition:
ConnectionAdapter.h:18
NetworkTableConnection
Definition:
NetworkTableConnection.h:30
ServerConnectionState
Definition:
ServerConnectionState.h:24
ServerAdapterManager
Definition:
ServerAdapterManager.h:21
ServerConnectionAdapter::badMessage
void badMessage(BadMessageException &e)
Definition:
ServerConnectionAdapter.cpp:33
ServerConnectionAdapter::shutdown
void shutdown(bool closeStream)
Definition:
ServerConnectionAdapter.cpp:53
EntryValue
Definition:
ITable.h:13
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.