vkottler / ifgen

An interface generator for distributed computing.
MIT License
1 stars 0 forks source link

Struct stream interfaces #13

Closed vkottler closed 1 year ago

vkottler commented 1 year ago

This comment example shows essentially what we're going for: https://stackoverflow.com/questions/1559254/are-there-binary-memory-streams-in-c

When using the >> / << read from some stream interface (???) the exact number of bytes in the struct, encode/decode, return.

vkottler commented 1 year ago

We want basic_ostream<uint8_t> and basic_istream<uint8_t, we should also make uint8_t an alias in the common header file.

https://en.cppreference.com/w/cpp/io

vkottler commented 1 year ago

Added basic stream read and write operator overloads for structs. Now it's time to try and manually test this.

At some point we should add a primitive-prefixed chunk streaming interface. That would be the missing piece at this point for automating some basic protocol encode and decode?

vkottler commented 1 year ago

This is all set: https://github.com/vkottler/ifgen/pull/12.