Now you can download a copy of these docs so you can use them offline! Download now
AbstractNetworkTableEntryStore.h
1 /*
2  * AbstractNetworkTableEntryStore.h
3  *
4  * Created on: Sep 16, 2012
5  * Author: Mitchell Wills
6  */
7 
8 #ifndef ABSTRACTNETWORKTABLEENTRYSTORE_H_
9 #define ABSTRACTNETWORKTABLEENTRYSTORE_H_
10 
11 
12 
15 
16 
17 #include "OSAL/Synchronized.h"
18 #include <string>
19 #include "networktables2/NetworkTableEntry.h"
20 #include "networktables2/IncomingEntryReceiver.h"
21 #include "networktables2/OutgoingEntryReceiver.h"
22 #include "networktables2/type/NetworkTableEntryType.h"
23 #include "tables/ITable.h"
24 #include "tables/ITableListener.h"
25 #include <map>
26 #include <vector>
27 
28 
29 
31 public:
32  virtual ~TableListenerManager(){}
33  virtual void FireTableListeners(std::string& name, EntryValue value, bool isNew) = 0;
34 };
35 
37 protected:
38  std::map<EntryId,NetworkTableEntry*> idEntries;
39  std::map<std::string,NetworkTableEntry*> namedEntries;
40  TableListenerManager& listenerManager;
41 
43 
44  OutgoingEntryReceiver* outgoingReceiver;
45  OutgoingEntryReceiver* incomingReceiver;
46 
47 
48 
49  virtual bool addEntry(NetworkTableEntry* entry) = 0;
50  virtual bool updateEntry(NetworkTableEntry* entry, SequenceNumber sequenceNumber, EntryValue value) = 0;
51 
52 public:
54 
56  NetworkTableEntry* GetEntry(EntryId entryId);
57  NetworkTableEntry* GetEntry(std::string& name);
58 
59  std::vector<std::string>* keys();
60  void clearEntries();
61  void clearIds();
62 
63  void SetOutgoingReceiver(OutgoingEntryReceiver* receiver);
64  void SetIncomingReceiver(OutgoingEntryReceiver* receiver);
65 
66  void PutOutgoing(std::string& name, NetworkTableEntryType* type, EntryValue value);
67  void PutOutgoing(NetworkTableEntry* tableEntry, EntryValue value);
68 
69 
70  void offerIncomingAssignment(NetworkTableEntry* entry);
71  void offerIncomingUpdate(NetworkTableEntry* entry, EntryId sequenceNumber, EntryValue value);
72 
73  void notifyEntries(ITable* table, ITableListener* listener);
74 
75 };
76 
77 
78 #endif /* ABSTRACTNETWORKTABLEENTRYSTORE_H_ */
void notifyEntries(ITable *table, ITableListener *listener)
Definition: ITable.h:26
void PutOutgoing(std::string &name, NetworkTableEntryType *type, EntryValue value)
void clearIds()
Definition: ITable.h:13
void clearEntries()

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