Skip to content

Quickstart

Greg "GothAck" Miell edited this page Mar 15, 2020 · 3 revisions

aka my ADD makes writing anything more in depth somewhat difficult.

1. Download, build, install

  • Install flatc from Flatbuffers
  • git clone this repo
  • make 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

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.