c++ Build class attributes from configuration file
<p>I've already implemented an algorithm using a class with hard coded attributes.</p>

<p>But now, I'd like add some flexibility to it.</p>

<p>Suppose that I've used only two attributes of the four available for <code>class Voice</code>.  By available, I mean that I have data for them, stored in a database.</p>

<pre><code>class Voice
{
    double price;                  // used this one.
    unsigned int duration;         // and this one.
    string destination;
    string operatorid;
}
</code></pre>

<p>I created a vector such that vector[0][0] = price of first element, vector[0][1] = duration of 1st element, and so on.</p>

<p>I'd like a user to edit a config file (I've been using <a href="http://code.jellycan.com/simpleini-doc/html/index.html" rel="nofollow">SimpleIni.h</a>), and add the attributes he wants, preferable in the order he desires, like for example:</p>

<pre><code>[Voice]
attribute1 = operatorid
attribute2 = price
attribute3 = duration
</code></pre>

<p><code>Voice</code> should than be built with these three attributes only so that vector[n] would have <code>vector[n][0]</code> = value of operatorid for <code>nth</code> element, <code>vector[n][1]</code> = value of price for <code>nth</code> element, <code>vector[n][2]</code> = value of duration for <code>nth</code> element.</p>

<p>Is this possible? How can I do it?</p>
