You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[C++]
I understood that SBE is for sending messages on wire, but often we use same types in our program to pass to functions and get values populated before doing so. Here we always need to provide buffer externally and maintain its lifetime
e.g.
Car carObj;
carObj.serialNumber(1234); //segmentation fault, as expected
can we generate something as below, this will enable developers not to maintain buffer explicitly. This will be backward compatible as we will not touch auto generated Car object.
This could be auto-generated, yes. But I think it is also possible to use a template to do this. Create a template that can hold an SBE codec (the template param) and use operator() to return the codec for usage. The template would hold the buffer as a std::array with the length being the largest expected length.
[C++]
I understood that SBE is for sending messages on wire, but often we use same types in our program to pass to functions and get values populated before doing so. Here we always need to provide buffer externally and maintain its lifetime
e.g.
Car carObj;
carObj.serialNumber(1234); //segmentation fault, as expected
can we generate something as below, this will enable developers not to maintain buffer explicitly. This will be backward compatible as we will not touch auto generated Car object.
struct CarWrapper{
CarWrapper(){
obj.wrap(buffer, 0, ..., ...)
}
Car obj;
char buffer[];
};
The text was updated successfully, but these errors were encountered: