Generic/single read/write wrapper? #1632
Unanswered
rmanaloto-tastytrade
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Is your metadata available at compile-time? Could you specialize
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to register one read and one write method for all my user defined structs?
I have code where I have metadata associated with each user defined type that I've generated that describes a field for a struct (its index in the aggregate, data type and semantic type, like if it is a uint64_t that represents a timestamp, etc...)
It would be somewhat tedious to setup all the glz::meta declarations and I want to piggy back off all of my meta data to generate the json serialization/deserialization
I'm not sure if this exists already, or totally hard to implement
The closest thing I've seen is glz::invoke, but the documentation regarding it is very hard to come by.
Ideally I would like to get access to the index in the aggregate that glaze is iterating on. Or the json element name and I can do the lookup myself when the method is called to read/write the json field.
I"m using a lot of the current reflection tricks out there (similar to glaze's reflection api) to map an aggregate field by index/name to its aggregate struct.
Beta Was this translation helpful? Give feedback.
All reactions