Home | Libraries | People | FAQ | More |
Table of Contents
Important | |
---|---|
Trial.Protocol is not an official Boost library. Trial.Protocol is still work-in-progress. |
Trial.Protocol is a header-only library[1] for processing (parsing, manipulating, and generating) encoded data for network wire protocols. Trial.Protocol contains several interfaces for parsing and generating encoded data, as well as a heterogeneous tree data structure that can be used as a parse tree.
Currently supported protocols[2] are:
Protocol processing can be done at any of three levels of abstraction:
At each level of abstraction there are processors for both parsing and generating protocol formats. These are summarized below.
Parser |
Generator |
|
---|---|---|
Incremental |
The encoded input can be parsed token by token with an incremental parser. For each token we can query the current token type and value. |
The encoded output can be generated token by token with an incremental generator. |
Serialization |
The encoded input can be deserialized directly into arbitrary C++ data structures with an input archive. |
Arbitrary C++ data structures can be serialized directly into encoded output with an output archive. |
Tree |
The encoded input can be parsed into a dedicated parse tree. |
The dedicated parse tree can be transformed into an encoded output. |
The protocol generators can write the encoded output to different types of buffers as long as an adapter exists for the buffer type. The correct header files must be included for this to work seamlessly.
Note | |
---|---|
For brevity all examples in this documentation assumes using namespace trial::protocol;
|
[1] Trial.Protocol serialization relies on Boost.Serialization, which is not header-only. Serialization is an optional feature.
[2] Trial.Protocol only supports protocols that can be tokenized without using a schema.
[3] Pull processors resembles a ForwardIterator, albeit with an interface closer to the Iterator pattern.
[4] Tree processing is similar to creating a Document Object Model.
Last revised: February 04, 2018 at 17:17:15 GMT |