All Projects → mapbox → Protozero

mapbox / Protozero

Licence: other
Minimalist protocol buffer decoder and encoder in C++

Projects that are alternatives of or similar to Protozero

Protodot
transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)
Stars: ✭ 107 (-39.55%)
Mutual labels:  protocol-buffers
Noproto
Flexible, Fast & Compact Serialization with RPC
Stars: ✭ 138 (-22.03%)
Mutual labels:  protocol-buffers
Protodep
Collect necessary .proto files (Protocol Buffers IDL) and manage dependencies
Stars: ✭ 167 (-5.65%)
Mutual labels:  protocol-buffers
Decoderbufs
INACTIVE: A PostgreSQL logical decoder output plugin to deliver data as Protocol Buffers
Stars: ✭ 116 (-34.46%)
Mutual labels:  protocol-buffers
Protobuf Java Format
Provide serialization and de-serialization of different formats based on Google’s protobuf Message. Enables overriding the default (byte array) output to text based formats such as XML, JSON and HTML.
Stars: ✭ 134 (-24.29%)
Mutual labels:  protocol-buffers
Protolint
A pluggable linter and fixer to enforce Protocol Buffer style and conventions.
Stars: ✭ 142 (-19.77%)
Mutual labels:  protocol-buffers
Tfrecords
Functions for creating tfrecords for TensorFlow models.
Stars: ✭ 105 (-40.68%)
Mutual labels:  protocol-buffers
Evans
Evans: more expressive universal gRPC client
Stars: ✭ 2,710 (+1431.07%)
Mutual labels:  protocol-buffers
Pb And K
Kotlin Code Generator and Runtime for Protocol Buffers
Stars: ✭ 137 (-22.6%)
Mutual labels:  protocol-buffers
Sbt Protobuf
sbt plugin for compiling protobuf files
Stars: ✭ 163 (-7.91%)
Mutual labels:  protocol-buffers
Go Proto Gql
Protobuff plugins for generating graphql schema and golang to graphql bindings. Also supports a graphql gateway (Alpha)
Stars: ✭ 127 (-28.25%)
Mutual labels:  protocol-buffers
Protoeasy Go
Simpler usage of protoc. Deprecated.
Stars: ✭ 129 (-27.12%)
Mutual labels:  protocol-buffers
Swift Apns
Swift Framework for sending Apple Push Notification over HTTP/2 API
Stars: ✭ 147 (-16.95%)
Mutual labels:  protocol-buffers
Twirp
PHP port of Twitch's Twirp RPC framework
Stars: ✭ 108 (-38.98%)
Mutual labels:  protocol-buffers
Protofuzz
Google Protocol Buffers message generator
Stars: ✭ 171 (-3.39%)
Mutual labels:  protocol-buffers
Protobuf
Protocol Buffers - Google's data interchange format
Stars: ✭ 52,305 (+29450.85%)
Mutual labels:  protocol-buffers
Restclient.net
.NET REST Client Framework for all platforms
Stars: ✭ 143 (-19.21%)
Mutual labels:  protocol-buffers
Protoc Jar Maven Plugin
Protocol Buffers protobuf maven plugin - based on protoc-jar multi-platform executable protoc JAR
Stars: ✭ 177 (+0%)
Mutual labels:  protocol-buffers
Buf
A new way of working with Protocol Buffers.
Stars: ✭ 3,328 (+1780.23%)
Mutual labels:  protocol-buffers
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (-16.95%)
Mutual labels:  protocol-buffers

protozero

Minimalistic protocol buffer decoder and encoder in C++.

Designed for high performance. Suitable for writing zero copy parsers and encoders with minimal need for run-time allocation of memory.

Low-level: this is designed to be a building block for writing a very customized decoder for a stable protobuf schema. If your protobuf schema is changing frequently or lazy decoding is not critical for your application then this approach offers no value: just use the C++ API that can be generated with the Google Protobufs protoc program.

Travis Build Status Appveyor Build Status Coverage Status Packaging status

Depends

  • C++11 compiler
  • CMake
  • Some tests depend on the Google Protobuf library, but use of Protozero doesn't need it

How it works

The protozero code does not read .proto files used by the usual Protobuf implementations. The developer using protozero has to manually "translate" the .proto description into code. This means there is no way to access any of the information from the .proto description. This results in a few restrictions:

  • The names of the fields are not available.
  • Enum names are not available, you'll have to use the values they are defined with.
  • Default values are not available.
  • Field types have to be hardcoded. The library does not know which types to expect, so the user of the library has to supply the right types. Some checks are made using assert(), but mostly the user has to take care of that.

The library will make sure not to overrun the buffer it was given, but basically all other checks have to be made in user code!

Documentation

You have to have a working knowledge of how protocol buffer encoding works.

The build process will also build the Doxygen-based reference documentation if you have Doxygen installed. Then open doc/html/index.html in your browser to read it.

Endianness

Protozero uses a very simplistic test to check the byte order of the system it compiles on. If this check is wrong, you'll get test failures. If this is the case, please open an issue and tell us about your system.

Building tests

Extensive tests are included. Build them using CMake:

mkdir build
cd build
cmake ..
make

Call ctest to run the tests.

The unit and reader tests are always build, the writer tests are only build if the Google Protobuf library is found when running CMake.

See test/README.md for more details about the test.

Coverage report

To get a coverage report set CXXFLAGS and LDFLAGS before calling CMake:

CXXFLAGS="--coverage" LDFLAGS="--coverage" cmake ..

Then call make as usual and run the tests using ctest.

If you are using g++ use gcov to generate a report (results are in *.gcov files):

gcov -lp $(find test/ -name '*.o')

If you are using clang++ use llvm-cov instead:

llvm-cov gcov -lp $(find test/ -name '*.o')

If you are using g++ you can use gcovr to generate nice HTML output:

mkdir -p coverage
gcovr . -r SRCDIR --html --html-details -o coverage/index.html

Open coverage/index.html in your browser to see the report.

Clang-tidy

After the CMake step, run

make clang-tidy

to check the code with clang-tidy. You might have to set CLANG_TIDY in CMake config.

Cppcheck

For extra checks with Cppcheck you can, after the CMake step, call

make cppcheck

Installation

After the CMake step, call make install to install the include files in /usr/local/include/protozero.

If you are using CMake to build your own software, you can copy the file cmake/FindProtozero.cmake and use it in your build. See the file for details.

Who is using Protozero?

Are you using Protozero? Tell us! Send a pull request with changes to this README.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].