Skip to content

serge-klim/transcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transcoder

compilation CodeQL codecov.io

Motivation

Simplify encoding/decoding tuples like C++ structures. It is might be useful for handling data coming from the wire. Such data usually needs to be packed/unpacked into platform specific object layout. As well as byte-ordered due to endianness differences.
Once data is represented as a C++ tuple or has Boost.describe metadata available, it can be used as simply as this:

auto encoded_buffer = tc::encode(message);
auto begin = encoded_buffer.data();
auto decoded_message = tc::decode<Message>(begin, begin+encoded_buffer.size());

here for example, implementation of Nasdaq TotalView-ITCH 5.0 protocol using this library.

described structures: https://github.com/serge-klim/md_prsr/tree/main/nasdaq/itch_v5.0
and usage example: https://github.com/serge-klim/md_prsr/blob/main/tools/nasdaq_itch_v5.0/message_dump.cpp#L19

how is it better than coded/generated parcer?

library avalible as vcpkg package transcoder via this vcpkg registry:

vcpkg-configuration.json example:

{
  "default-registry": {
    "kind": "git",
    "repository": "https://github.com/microsoft/vcpkg",
    "baseline": "80d54ff62d528339c626a6fbc3489a7f25956ade"
  },
  "registries": [
    {
      "kind": "git",
      "repository": "https://github.com/serge-klim/pkgs",
      "baseline": "ebfbf2ff2491e3728374b7e8524f755b110e3a4c",
      "packages": [ "transcoder" ]
    }
  ]
}

About

helper library to transorm Boost.Fusion/Boost.Describe anotated structures

Resources

Stars

Watchers

Forks

Packages

No packages published