Commit Graph

13 Commits

Author SHA1 Message Date
Peter Johnson
8aac46542d Add a SimpleBufferPool for uv::Buffer (#1215)
Buffers are reused on a regular basis in many use cases.
2018-07-25 00:58:54 -07:00
Peter Johnson
c25d48fd0c HttpParser: Add Reset() function (#1210)
This allows reuse of the HttpParser object for multiple requests.
2018-07-22 19:41:23 -07:00
Peter Johnson
297863b17a Add HttpParser and UrlParser C++ wrappers for http_parser. 2018-07-17 02:24:56 -07:00
Peter Johnson
e2314f3528 wpiutil: Add C++ libuv wrappers (#1166)
- Provide an EventLoopRunner to run uv::Loop on a separate thread.

- Add raw_ostream wrapper for uv::Buffer.
2018-07-17 01:06:24 -07:00
Peter Johnson
70960b0251 Signal: rename Signal to Signal_mt and Signal_st to Signal.
The single-threaded version is fine for most of the use cases we're planning
on, and is half the size on most platforms.
2018-06-30 00:21:09 -07:00
Peter Johnson
c8afe9bc2f Signal: Optimize to use plain std::function.
This optimizes the common case of a single simple callback (e.g. std::function
or lambda) so no additional allocation is required.  As a Connection return
value is not possible in this case, provide a separate connect_connection()
function to provide that.
2018-06-30 00:21:09 -07:00
Peter Johnson
876c650471 wpiutil: Add a signal-slot implementation. (#1163)
Imported from https://github.com/palacaze/sigslot

Classes were renamed from lowercase_me to UppercaseMe style, primarily
to avoid conflicting with the C standard library "signal" function.  They
were also moved to the "wpi::sig" namespace.
2018-06-27 23:01:17 -07:00
Peter Johnson
7cd15aa049 Re-enable JsonIteratorObjectTest.KeyValue. 2018-05-15 22:31:35 -07:00
Peter Johnson
f8ed48af98 Update json from upstream version 3.1.2.
This adds support for ubjson and makes a number of bugfixes.

Binary input and output have switched from strings to uint8_t arrays.
2018-05-15 22:31:35 -07:00
Tyler Veness
5ff3d837b6 Fix compilation with GCC 8 (#1051)
The anonymous namespace was renamed due to -Wsubobject-linkage complaining
about a field created in a GTest template class (CborRoundtripTestParam)
being defined in an anonymous namespace. See
https://stackoverflow.com/a/37723265.
2018-05-13 23:11:13 -07:00
Thad House
f07799c67b Disables unstable and failing unit tests (#1057) 2018-05-13 21:59:45 -07:00
Peter Johnson
f84018af5f Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing
llvm symbols from dependent libraries to resolve to that library instead of
this one. This has been seen in the wild with the Mesa OpenGL implementation
in JavaFX applications (see wpilibsuite/shuffleboard#361).

This is clearly a very breaking change. For some level of backwards
compatibility, a namespace alias from llvm to wpi is performed in the "llvm"
headers.  Unfortunately, forward declarations of llvm classes will still break,
but compilers seem to generate clear error messages in those cases
("namespace alias 'llvm' not allowed here, assuming 'wpi'").

This change also moves all the wpiutil headers to a single "wpi" subdirectory
from the previously split "llvm", "support", "tcpsockets", and "udpsockets".
Shim headers will be added for backwards compatibility in a later commit.
2018-04-30 10:22:54 -07:00
Peter Johnson
0f947613a9 Prepare wpiutil for merge into allwpilib. 2018-04-27 19:56:51 -07:00