corda/experimental/cpp-serializer
Katelyn Baker 8f7346f84c
NOTICK - Add C++ Serialiser Support for Maps and Arrays ()
Adds support for understanding both Maps and Arrays

Irritatingly, whilst arrays are mostly serialized as lists, we cannot simply use a restricted List reader to deserialize them because there are subtle differences in the way we need to work out if its actually a restricted type or not. Rather than add a bunch of random logic into the factory method I've isolated it in the class hierarchy. So a little bit more code makes the implementations a lot neater. We also need to deal with the fact arras of unboxed primitives exist, which whilst Java really gets excited about, we don't need to care about. An int, is an int, is an int!.

Map support required we add a slightly better Value dumper, essentially the "key" component of the KV pair needs to be more flexible than a simple string when we're dumping out param:value pairs.

Testing
Added a lot more unit tests to both the ordered type notation code to ensure we build up the schema dependency struct in the correct order. Quite important as we rely on that in the composite factory to be strictly ordered to ensure we're not constructing a reader for a type we don't yet understand... and there were some small bugs in the version that predates this PR

Also added a lot higher level tests to ensure actual reading out of the blob works
2019-12-13 00:32:25 +00:00
..
bin NOTICK - Add C++ Serialiser Support for Maps and Arrays () 2019-12-13 00:32:25 +00:00
include NOTICK - Add C++ Serialiser Support for Maps and Arrays () 2019-12-13 00:32:25 +00:00
src NOTICK - Add C++ Serialiser Support for Maps and Arrays () 2019-12-13 00:32:25 +00:00
.gitignore NOTICK - CPP project gitignore 2019-08-16 12:58:23 +01:00
CMakeLists.txt NOTICK - fix cpp serialiser under linux () 2019-12-11 10:35:45 +00:00
lines NOTICK - Add C++ Serialiser Support for Maps and Arrays () 2019-12-13 00:32:25 +00:00
README.md NOTICK - fix cpp serialiser under linux () 2019-12-11 10:35:45 +00:00
rem_cmake NOTICK - Add C++ Serialiser Support for Maps and Arrays () 2019-12-13 00:32:25 +00:00

Corda Blob Inspection

This is a best effort attempt at a C++ implemention of the CORDA serialization framework in a non JVM language. The initial target is a working "blob inspector", that is an exe that can take a serialised blob from a vault (or other) and decode it using C++.

Currently Working

An implementation of a "blob inspector" that can take a serialised blob and decode it into a printable JSON format where that blob contains a constrained set of types. The current limitation with this implementation is that it does not understand associative containers (maps).

Fututre Work

  • Encode and decode of local C++ types
  • Decpdable encode of native types
  • Some schema generation from the JVM canonical source

Dependencies

  • qpid-proton
  • C++17
  • gtest
  • cmake

Setup

MacOS

  • brew install cmake
  • brew install qpid-proton

Google Test

Linux (Ubuntu)

  • sudo apt-get install cmake
  • sudo apt-get install libqpid-proton8-dev
  • sudo apt-get install libgtest-dev

And now because that installer only pulls down the sources

  • cd /usr/src/googletest
  • sudo cmake .
  • sudo cmake --build . --target install