of course, my basic template class to store the info is something like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
template <typename TDATA,typename TREG>
class datos{
public:
TDATA dato;
TREG tipo;
/*initialization list*/
datos(
TDATA vdato = TDATA(),
TREG tipo_dato = TREG()
):
dato( vdato ),
tipo( tipo_dato )
{ }
};
|
Then in another superior class, I have a vector that contains (among other things) elements of type
vector <datos<TDATA,TREG> >
This, basically is designed to get data itself and its type, being the type a predefined char or int values , depending, but knowing this types of course. Of corse data can be integer, double, string .. whatever.
So, my problem is that i have to be able to read a delimited and previously unknown file and fill the information in vectors like the above and then write them to files. To do that, I have to create instances of this classes , but I don´t know how many at compile time, and the real problem, I don´t know how to asign them a name to control them.
Right now I´m thinking about the posibility of reading all as strings, putting all in a vector of fields(type string) and then build a class object whith the values converted through istream for example. But this solution can throw problems with memory because I have to work with very large amounts of data.
Hope you understand the problem better now. Thank you again.