ZeroBuf icon indicating copy to clipboard operation
ZeroBuf copied to clipboard

Problem with ZeroBuff and [string] type

Open ccrisrober opened this issue 7 years ago • 1 comments

I'm Cristian Rodriguez, from the group working back in URJC/UPM with Pablo Toharia. Right now I'm trying to use a custom ZeroBuff fbs file that required a std::vector of char* (or vector) but zerobufCxx generates a std::vector when I use string or [string]. My fbs file contains:

namespace zeroeq.gmrv;

table SelectionStr
{
 ids:[string];
}

I've seen in the python script (zerobufCxx) it converts string to zerobuf::Vector< char >. With the following fbs, I get the same result in the two attributes:

namespace zeroeq.gmrv;

table SelectionStr
{
 fooStrArr:[string];
 fooStr:string;
}

I had been trying to modify your Python script to generate std::vector (string) and std::vector<char*> ([string]), but I prefer to ask you how can I resolve this without change the script. Any ideas on this? Thank you!

ccrisrober avatar Mar 02 '17 11:03 ccrisrober

Hi Cristian,

ZeroBuf does not yet support dynamic arrays of dynamic-sized types. This is on the list, but due to the complexity of implementing the allocator code not a very popular topic. ;)

eile avatar Mar 03 '17 14:03 eile