Open piperoc opened 4 months ago
Sorry, I just saw the issue 22 . I looked at it before but did not understand it.
Are you suggesting that I wrap complex data into a string:
message SimpleMessage [id = 30000] {
uint32 msg_id [ id = 1 ];
string msg_payload [ default = "Hello World!", id = 2 ];
}
message ComplexMessage [id = 30001] {
uint32 complex_msg_id [ id = 1 ];
string ListOfSimpleMessges [ id =2 ];
}
but that means that I will have to encode/decode that string property on my own -- which sounds like creating my own serializer.
I am not questioning, just asking.
I like the library in any case because it's so portable, but I need a more complete serialization.
As a test, I actually combined libcluon
with a simple yet powerful serialization library called cereal .
Doing that I can send complex objects across and libcluon
seems ok with that.
Just to share the (very crude and quick) test code for a sender and receiver over TCP (to be compiled as separate programs):
However, something like protobuf would be more powerful and standard. I will welcome any advise. Thanks again.
This project looks like a great idea.
I was trying to test, but I'm confused a bit.
It took me a minute but I eventually understood that I cannot define my protobuf messages using the actual google proto language. I must use the format that the
cluon-msc
converter understands.However, that seems pretty limited to scalar values, no arrays or "repeated" structures.
An example in proto language (very simple):
does not have a corresponding sintax in "odvd":
If I want something more complex like that, am I expected to extend the classes with definitions of things like you have in your
cluon::data
namespace? I'm asking because I did not see much info on that other than looking at the code.Thanks in advance.