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
I can't merge Keyed and Named members into a single collection due to performance penalty. And I can't merge Sess and Trans members because items in Sess remain unchanged, while items in Trans are cleared on every transaction.
Now I have to serialize all properties from both objects and collections into a flat list of name-value pairs of a single json object:
Below is the linear iteration that generates each pair, but I don't know how to express serialization rules/representation in Glaze API.
auto rep = GetReport();
for (const auto& [n, v] : rep.Sess.Named)
write_json_property(n, v);
for (const auto& [k, v] : rep.Sess.Keyed)
write_json_property(GetKeyName(k), v);
for (const auto& [n, v] : rep.Trans.Named)
write_json_property(n, v);
for (const auto& [k, v] : rep.Trans.Keyed)
write_json_property(GetKeyName(k), v);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a structure like this:
I can't merge Keyed and Named members into a single collection due to performance penalty. And I can't merge Sess and Trans members because items in Sess remain unchanged, while items in Trans are cleared on every transaction.
Now I have to serialize all properties from both objects and collections into a flat list of name-value pairs of a single json object:
Below is the linear iteration that generates each pair, but I don't know how to express serialization rules/representation in Glaze API.
Beta Was this translation helpful? Give feedback.
All reactions