Commit Graph

15 Commits

Author SHA1 Message Date
Peter Johnson
0f4eecebe6 Fix StorageTest on MSVC.
MSVC outputs %g with a 3-digit instead of a 2-digit exponent.
2015-08-24 21:30:07 -07:00
Peter Johnson
c27a1cec48 Unbreak StorageTest. 2015-08-22 23:26:22 -07:00
Peter Johnson
4670ef6ec5 Refactor StorageTest base class. 2015-08-01 16:33:52 -07:00
Peter Johnson
67de7af7b2 Storage: Use unique_ptr instead of shared_ptr for Entry. 2015-08-01 11:47:35 -07:00
Peter Johnson
3b207ad2c3 StorageTest: Fix string comparison for Warn().
Previously this was comparing pointers rather than the string contents.
2015-08-01 11:45:41 -07:00
Peter Johnson
cde7782c21 Make StorageEntry a struct and move into Storage class. 2015-07-31 13:48:33 -07:00
Peter Johnson
138ebf5b4d Storage: generate messages rather than intermediate updates. 2015-07-31 13:21:19 -07: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
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
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
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
29691e0ac5 StorageTest: Add LoadPersistent and SavePersistent coverage. 2015-07-19 22:45:20 -07:00
Peter Johnson
b0802f3e26 StorageTest: Add fixture classes, add GetEntryInfo test. 2015-07-19 19:43:27 -07:00
Peter Johnson
67ae9e1ba7 Add initial set of unit tests for Storage. 2015-07-19 18:11:36 -07:00