Dgeodjo / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 1 forks source link

Add repeated flag to field description #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The generated code for the field type does not allow to distinct between 
singular and repeated callback-based types. Adding an additional flag to 
pb_field_t could resolve this issue.

Original issue reported on code.google.com by michael....@gmail.com on 21 Jan 2013 at 7:10

GoogleCodeExporter commented 9 years ago
Probably the best place to encode this information would be PB_HTYPE_*. Sounds 
like a change that will require atleast regenerating the .pb.c files.

Can you elaborate why you need to distinguish repeated/required/optional fields 
in callbacks programmatically?

Original comment by Petteri.Aimonen on 21 Jan 2013 at 7:14

GoogleCodeExporter commented 9 years ago
I'm planning to use nanopb in a middleware project I'm currently working on. As 
I use mixed C/Python code, I would like to implement a Cython-Wrapper generator 
for the generated NanoPB structures. When implementing some first ideas I 
realized that I could avoid some code duplication if a repeated flag would be 
available. Explicitly, I could use a common callback function for all kinds of 
callback fields (without assuming that they are all repeated).

However, as my first release will still be using Google's implementation, it is 
in no way urgent or important. I hope to get a student assistent soon who 
should look further into possibilities for Cython/nanopb usage within my 
project.

Original comment by michael....@gmail.com on 22 Jan 2013 at 8:27

GoogleCodeExporter commented 9 years ago
Seems reasonable. I'm not sure how you will implement the wrapper, but adding 
that piece of information to the PB_HTYPE is quite easy.

However because it requires regenerating the .pb.c files I'll probably make it 
on a separate branch and integrate at some suitable time.. maybe when I run out 
of version numbers for 0.1.x :)

Original comment by Petteri.Aimonen on 23 Jan 2013 at 6:33

GoogleCodeExporter commented 9 years ago

Original comment by Petteri.Aimonen on 7 Feb 2013 at 3:29

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 41f98343c8e4.

Original comment by Petteri.Aimonen on 20 Feb 2013 at 8:57

GoogleCodeExporter commented 9 years ago
Fix released in nanopb-0.2.0.

Original comment by Petteri.Aimonen on 2 Mar 2013 at 2:39