Quickstart - GothAck/FlatRPC GitHub Wiki
aka my ADD makes writing anything more in depth somewhat difficult.
1. Download, build, install
- Install flatc from Flatbuffers
git clone
this repomake all
sudo make install
2. Set up your project however you wish
No really, I don't prescribe cmake, make, or anything, just know how to call flatc
and flatrpcc
.
3. Write your flatbuf schema
-
Pay special attention to "RPC interface declarations" in the latter document, this project will transform these into your services and calls.
4. Generate your code
flatc --cpp --gen-mutable --gen-name-strings --gen-object-api --gen-compare --reflect-names --cpp-ptr-type std::shared_ptr --cpp-std c++17 $FILENAME
Note that shared_ptr as ptr-type is kinda required at the moment, this may go away later on, I prefer it, but I understand not everyone will; object API is required, again this may be optional in the future once I get flatter server side calls working.flatbufcc $FILENAME
5.
- See
examples/simple/greeter_server.{hpp,cpp}
for an example on how to use the generated server stubs and implement your methods. - You can use the client as is, or you can subclass it to add further functionality, it's up to you.