Peter Johnson
f6576b18f7
Storage: Add more Dispatcher accessors.
2015-07-29 20:33:13 -07:00
Peter Johnson
9a621e9272
Various NetworkConnection improvements.
...
- Keep connection state.
- Store remote id
- Getter for proto_rev
- Cleanup on Stop()
- Cleaner termination of write thread.
2015-07-29 20:31:59 -07:00
James Kuszmaul
4b575e3e7e
Replaced ::std with std for readability/consistency.
...
Change-Id: I65f9673c237d3513f99827e28963eb22ae9df0c2
2015-07-29 16:48:04 -04:00
Peter Johnson
c01f2977ac
StorageEntry: Make value() const.
2015-07-28 22:29:58 -07:00
Peter Johnson
683c53babc
Message::str(): Return StringRef.
2015-07-28 22:07:02 -07:00
Peter Johnson
5823e3c780
Storage: Add CreateEntry function for Dispatcher use.
2015-07-28 22:06:42 -07:00
James Kuszmaul
cbc372c71e
Temporarily disable MutexTests until artf4167 is resolved.
...
Change-Id: I09f4e48ff304df312daf4ebb77681965acf6066d
2015-07-27 11:51:29 -04:00
Peter Johnson
a0d30ffef1
Storage: Use StringMap instead of ConcurrentQueue for updates.
...
Updates are merged or themselves updated as user code changes. This avoids
the need for the dispatcher to do this and also avoids the need for disabling
updates when the dispatcher isn't running, because there's no risk of memory
usage piling up.
2015-07-26 20:41:48 -07:00
Peter Johnson
fb1b82e239
StorageEntry: Also store copy of name here.
...
This wastes a bit of space but is necessary for assign message generation.
2015-07-26 10:28:20 -07:00
Peter Johnson
3bc5699ba1
Storage: Provide accessor for global mutex.
2015-07-26 09:42:14 -07:00
Peter Johnson
18659257d3
Storage: Make setters globally atomic.
...
Previously, setters were locally but not globally atomic because they
used GetEntry() (globally atomic) in conjunction with locally atomic
gets/sets to the StorageEntry. To support synchronizing network handshakes
they need to be globally atomic.
GetEntry() has been removed due to this issue, so a helper was added to
StorageTest instead.
2015-07-26 09:27:23 -07:00
Peter Johnson
3c7cb363ba
NetworkConnection: Prefer emplace to push.
2015-07-25 10:47:53 -07:00
Peter Johnson
787d39851b
Update gradle build to match cmake build.
2015-07-25 01:33:15 -07:00
Peter Johnson
ae070aca70
Value: Add type check functions.
2015-07-24 22:11:57 -07:00
Peter Johnson
63dd895e6d
Pass CMAKE_TOOLCHAIN_FILE down to external project (gmock).
2015-07-23 22:31:51 -07:00
Peter Johnson
507b083e77
WireEncoderTest.cpp: Don't test compiler truncation.
2015-07-23 22:06:57 -07:00
Peter Johnson
13bc05d9ec
leb128Test: Fix incorrectly sized constants.
2015-07-23 22:04:51 -07:00
Peter Johnson
3f24b86875
ITable: Add Persist function to make a key persistent.
2015-07-23 21:53:33 -07:00
Peter Johnson
1368f0ec8f
NetworkTable: Use networktables.ini as persistence filename.
2015-07-23 21:47:54 -07:00
Peter Johnson
196fcf791b
ITable: Const'ify getter functions.
2015-07-23 21:46:30 -07:00
Peter Johnson
6bccf528d7
ITableListener.h: Forward declare ITable.
2015-07-23 21:41:30 -07:00
Peter Johnson
1fc03803cd
ITableListener::ValueChanged: Don't make key const.
2015-07-23 21:40:24 -07:00
Brad Miller (WPI)
f74ca87e26
Merge "NamedSendable::GetName() is now const qualified"
2015-07-23 07:49:02 -07:00
Brad Miller (WPI)
5756be5c23
Merge "Fix std::unique_ptrs using incomplete types"
2015-07-23 07:48:05 -07:00
Brad Miller (WPI)
2da3f7f89b
Merge "Replaced all uses of DISALLOW_COPY_AND_ASSIGN macro"
2015-07-23 07:46:51 -07:00
Brad Miller (WPI)
cf965d26a0
Merge "Make test scripts spawn driverstation as admin."
2015-07-23 07:45:17 -07:00
Brad Miller (WPI)
af3eaae090
Merge "Comment out SetPriority() in Task constructor."
2015-07-23 07:43:17 -07:00
Peter Johnson
8fa0e6c914
Add shims for old NetworkTable interface.
...
This provides classes for virtual subtables using path delimiters within
the global NetworkTable namespace.
2015-07-23 01:23:09 -07:00
Peter Johnson
6f940bcaaf
Add immediate_notify and is_new to entry listener.
...
On the callback function, is_new indicates the value is newly added.
On adding a callback function, immediate_notify indicates the callback
should be called once (with is_new=true) for each matching entry that
already exists.
2015-07-23 01:02:53 -07:00
Peter Johnson
79f732f239
Import llvm::SmallString and dependencies.
...
Update StringRef and StringExtras with SmallVector functions.
2015-07-22 22:29:46 -07:00
Peter Johnson
593bc28446
Move StringMap.h and StringExtras.h to public includes.
...
While these aren't required by the public interface, they are generally
useful classes for users of the library.
2015-07-22 22:10:56 -07:00
Peter Johnson
9c204533e8
Value: Disambiguate std::string&& and StringRef.
...
Making the former a template causes the compiler to prefer the latter
when given a bare C string.
2015-07-22 22:08:13 -07:00
Peter Johnson
4c14f7823a
ntcore_cpp.h: Comment cleanup.
2015-07-22 21:41:25 -07:00
Peter Johnson
4aa2d65bba
Storage: Use std::forward and emplace for updates.
2015-07-21 22:43:44 -07:00
Peter Johnson
bb5848a033
ConcurrentQueue: Add emplace function.
...
Also use std::forward for rvalue push.
2015-07-21 22:43:02 -07:00
Peter Johnson
9f728b850e
Add MSVC specific compiler flags.
2015-07-21 21:14:22 -07:00
James Kuszmaul
9c2678fdb9
Make test scripts spawn driverstation as admin.
...
Change-Id: Ic7f27fa902b2ac67c6785b7f422601ade3d23f2c
2015-07-21 08:50:43 -04:00
Tyler Veness
3bbeccfbb5
Replaced all uses of DISALLOW_COPY_AND_ASSIGN macro
...
Change-Id: I8371beb286a20d4c7619aab226136569fdefafef
2015-07-21 01:23:34 -07:00
Peter Johnson
b4c65dc210
Make global instance init thread-safe.
...
Use local statics except for Visual C++ < 2015.
2015-07-20 23:36:22 -07:00
Peter Johnson
5df62ac172
Storage: Disable use of update queue by default.
...
This ensures we don't "leak" memory for local use when the dispatch thread
is not running.
2015-07-20 22:24:47 -07:00
Peter Johnson
0979c1c9ca
Storage, NetworkConnection: Don't in-place construct atomics.
...
Visual C++ 2013 doesn't support this.
2015-07-20 20:52:26 -07:00
Peter Johnson
8bbe5f9fdb
ArrayRef: Add portability checks for constexpr.
2015-07-20 20:49:49 -07:00
Tyler Veness
881dcd08e5
Fix std::unique_ptrs using incomplete types
...
CANTalon declared a std::unique_ptr<CanTalonSRX> with CanTalonSRX as an incomplete type. This causes a compilation error in code using CANTalons. The CANTalonTest didn't catch this because it included ctre/CanTalonSRX.h as well as CANTalon.h. Normal user code doesn't do that.
I reviewed uses of std::unique_ptr elsewhere and determined that PIDCommand may suffer from the same problem. There is no test for PIDCommand to prove otherwise.
Change-Id: I54caf4941927910471ffb7170eb6737ba0e08437
2015-07-20 20:39:49 -07:00
Peter Johnson
3cd3d1691e
Message: Use #define instead of constexpr.
2015-07-20 20:34:19 -07:00
Peter Johnson
6b2fb02bed
Dispatcher: Don't in-place construct atomics.
...
Visual C++ 2013 doesn't support this.
2015-07-20 20:21:37 -07:00
Peter Johnson
8938a19810
Dispatcher: Avoid warning by using for(;;) instead of while(true).
2015-07-20 20:20:01 -07:00
Peter Johnson
158ae61811
Dispatcher::SetUpdateRate(): Explicitly convert to int.
2015-07-20 20:19:01 -07:00
James Kuszmaul
6bd2534f0e
Comment out SetPriority() in Task constructor.
...
Change-Id: I82bdab5558f328d686461556b9425ddec878eb6b
2015-07-20 19:38:06 -04:00
Tyler Veness
451c4e81c3
NamedSendable::GetName() is now const qualified
...
Change-Id: Ie9e4daac4473e44f4248385f992da750501443e5
2015-07-20 16:17:29 -07:00
James Kuszmaul
eb7d55fd59
Fixed classes with undefined constructor.
...
IterativeRobot and BinaryImage had no constructor
defined (and so would give linker errors).
Error just had an empty constructor defined,
so I switched to "=default".
Change-Id: Ia8efb4282928227878dfefeda58ccb8cf06aabb2
2015-07-20 17:31:44 -04:00