Home » U++ Library support » U++ MT-multithreading and servers » How to pass vector/array of structs to witz?
Re: How to pass vector/array of structs to witz? [message #40327 is a reply to message #40322] |
Fri, 19 July 2013 15:58 |
|
Hi Zbych,
If I'm not mistaken, the closest you can get is to use ValueArray instead of Array and ValueMap instead of DataSet. ValueArray/Map are not really ergonomic to handle, so the best approach is probably to convert your data before passing them to witz.
Something likestruct DataSet{
int data1;
double data2;
String data3;
};
Array<DataSet> set;
ValueArray v;
for (int i=0; i<set.GetCount(); ++i) {
ValueMap vm;
vm["data1"]=set[i].data1;
vm["data2"]=set[i].data2;
vm["data3"]=set[i].data3;
v.Add(vm);
}
http("set", v);
Note: I'd not try to compile or run the code
It is quite verbose, so some helper functions might be a good idea...
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Thu May 23 17:06:12 CEST 2024
Total time taken to generate the page: 0.01686 seconds
|