Commit Graph

114 Commits

Author SHA1 Message Date
Peter Johnson
8bbe5f9fdb ArrayRef: Add portability checks for constexpr. 2015-07-20 20:49: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
Peter Johnson
98d45777c6 Remove unnecessary llvm qualifier. 2015-07-20 00:19:20 -07:00
Peter Johnson
d059022071 Add logging to TODO. 2015-07-19 23:52:12 -07:00
Peter Johnson
c9260ea785 Change GetEntryTypeFunc to std::function.
Also implement it as a member function of Dispatcher.
2015-07-19 23:17:14 -07:00
Peter Johnson
c9ca2f902e Add TODO list. 2015-07-19 22:56:48 -07:00
Peter Johnson
29691e0ac5 StorageTest: Add LoadPersistent and SavePersistent coverage. 2015-07-19 22:45:20 -07:00
Peter Johnson
a3fcce891f LoadPersistent: Fix various bugs. 2015-07-19 22:44:34 -07:00
Peter Johnson
8db016c223 SavePersistent: Sort in name order, fix list commas. 2015-07-19 21:10:20 -07:00
Peter Johnson
b0802f3e26 StorageTest: Add fixture classes, add GetEntryInfo test. 2015-07-19 19:43:27 -07:00
Peter Johnson
e4731a4e4e Storage::GetEntryInfo: Actually filter on types. 2015-07-19 19:42:13 -07:00
Peter Johnson
67ae9e1ba7 Add initial set of unit tests for Storage. 2015-07-19 18:11:36 -07:00
Peter Johnson
d6afbc56c4 Storage: Delete functions now delete from map.
This is ok due to the map storing shared_ptr.
2015-07-19 18:10:26 -07:00
Peter Johnson
ffb54872c0 Storage::SetEntryFlags(): Fix deadlock, check for empty name. 2015-07-19 17:50:31 -07:00
Peter Johnson
ead6b4960f Storage: Use make_shared instead of reset. 2015-07-19 16:46:59 -07:00
Peter Johnson
21b7acc397 Storage: Make testable, make EntriesMap typedef private. 2015-07-19 16:36:30 -07:00
Peter Johnson
173111c64c ConcurrentQueue: Make mutex mutable. 2015-07-19 16:36:08 -07:00
Peter Johnson
cf18355fe2 Unit tests: Prefer constructor to SetUp() in fixtures. 2015-07-19 16:30:04 -07:00
Peter Johnson
1cc148848b StartServer: Take persist_filename as a StringRef. 2015-07-19 16:11:56 -07:00
Peter Johnson
ec54904347 Tighten up C++ API implementation a bit. 2015-07-19 16:09:59 -07:00
Peter Johnson
0a18d2e57b Storage: Make individual entries thread safe.
Also use shared_ptr to refer to entries rather than names.
2015-07-19 16:02:21 -07:00
Peter Johnson
c08e2ed8fc ConcurrentQueue: Add size() function. 2015-07-18 01:32:21 -07:00
Peter Johnson
2437f06c7f Implement majority of Storage functionality.
It's also now thread-safe.
2015-07-18 01:29:51 -07:00
Peter Johnson
9b7e265762 Continue implementing client. 2015-07-18 01:29:24 -07:00
Peter Johnson
c4a7f6ec9b SavePersistent: Safely save through temp file.
Also change SavePersistent and LoadPersistent to take StringRef.
2015-07-18 00:39:08 -07:00
Peter Johnson
d05656b716 StorageEntry: Make data public, remove accessors.
Also add id and seq_num fields.
2015-07-17 23:41:25 -07:00
Peter Johnson
04789d9ae4 SequenceNumber: Add default constructor. 2015-07-17 23:41:05 -07:00
Peter Johnson
77acf1f35b Implement Flush() API. 2015-07-17 22:40:00 -07:00
Peter Johnson
412e8034de Start implementing client and server. 2015-07-17 22:39:36 -07:00
Peter Johnson
a6162ba990 NetworkConnection: Trigger threads as necessary in Stop(). 2015-07-17 22:28:47 -07:00
Peter Johnson
7c51178608 TCPAcceptor: Add shutdown() function. 2015-07-17 22:28:13 -07:00
Peter Johnson
899c489124 TCPStream: Shutdown on close. 2015-07-17 22:27:49 -07:00
Peter Johnson
3062e1e740 Message: Add data accessors. 2015-07-17 19:41:40 -07:00
Peter Johnson
854bfba7c9 Value: Set last_change field. 2015-07-17 11:16:03 -07:00
Peter Johnson
1d4de091f9 Implement nt::Now(). 2015-07-17 11:15:44 -07:00
Peter Johnson
440916cf2a Fix string terminator in char** output. 2015-07-17 10:16:46 -07:00
Peter Johnson
3f4feb2f5c Remove unused variable. 2015-07-17 10:16:31 -07:00
Peter Johnson
3025a7e51e Finish C wrappers. 2015-07-17 08:47:25 -07:00
Peter Johnson
fcbd2751ba Provide C++ API. Move all classes to "nt" namespace.
The C API is now just simple wrappers around the C++ API.
2015-07-17 07:21:07 -07:00
Peter Johnson
56f1481c24 Add Dispatcher. 2015-07-16 22:55:50 -07:00
Peter Johnson
2ea20b8e81 Value: Use NT_Value for internal storage.
This saves a tiny bit of space, but also allows for the NT_Value equivalent
of a Value to be provided with no copy cost (will be useful in the C API).
2015-07-16 21:44:37 -07:00
Peter Johnson
9906116d23 Don't base Value on NT_Value.
Also use std::string instead of NT_String.

Conversions to/from the internal structures will be done at the interface.
2015-07-16 01:38:27 -07:00
Peter Johnson
555725a05b NetworkConnection: Don't explicitly declare default move constructor. 2015-07-15 23:29:17 -07:00
Peter Johnson
13cbf4e288 Message: use shared_ptr.
NetworkConnection: Own the input and output queues.
2015-07-15 21:20:18 -07:00
Peter Johnson
beb92e6cbf NetworkConnection: Ignore duplicate Start() calls. 2015-07-14 23:15:30 -07:00
Peter Johnson
4d3fb3c497 Storage: Use unique_ptr for instance. 2015-07-14 23:15:08 -07:00
Peter Johnson
dbd0c98306 Message: implement MsgType constructor. 2015-07-14 23:09:56 -07:00