C++, creating classes in runtime
<p>I have a query, I have set of flat files ( say file1, file2 etc) containing column names and native data types. ( how values are stored and can be read in c++ is elementary)
eg. flat file file1 may have data like
col1_name=id, col1_type=integer, col2_name=Name, col2_type=string and so on.</p>

<p>So for each flat file I need to create C++ data structure ( i.e  1 flat file = 1 data structure)  where the member variable name is same name as column name and its data type will be of C++ native data type like int, float, string etc. according to column type in flat file.
from above eg: my flat file 1 should give me below declaration</p>

<pre><code>class file1{
  int id;
  string Name;
};
</code></pre>

<p>Is there a way I can write code in C++, where binary once created will read the flat file and create data structure based on the file ( class  name will be same as flat file name). All the classes created using these flat files will have common functionality of getter and setter member functions.</p>

<p>Do let me know if you have done something similar earlier or have any idea for this.</p>
