// When I said generating a schema as text, I meant creating it as a string
I see your point now. Yes, I guess that this would create a more concise and less error prone code compared to my example, which requires quite a lot of code to build a relatively short schema.
// I don't quite follow you code sample.. there is no API available that does what you want.
It is kind of funny that you said that because I compared the schema obtained by a Parser with the one that I build by "hand" using the API provided by reflection_generated.h, and they look pretty much the same ;)
// Can you explain me what you're trying to do? Why can't you work with a schema the traditional way?
Honestly, I have the feeling that this is not the topic of the thread, but anyway...
Long story short:
Reflection is meant to be used to avoid the "compilation" step on the reader side. What I am trying to do is to avoid that step also on the writer side.
I am trying to build a very basic profiler that stores some time series with as little overhead as possible. The number of fields, their name and the type is specified at runtime, during startup.
Since the number of fields of the root_table is not defined at compilation time, I can't follow the usual workflow.
Anyway, I understand your point.
I will use the parser to generate the schema instead of the functions provided by reflection_generated.h.
Davide