#include <iostream>
using namespace std;

#include "db.hpp"




int main()
{
    enum tata {ID, OK, LETTER, DECIMAL, VARCHAR, STILLOK};
    typedef reg<int, reg<bool, reg<char, reg<float, reg<const char *, reg<bool> > > > > > d;
    
    d row;
    row.set(1);
    row.next().set(true);
    row.next().next().set('b');
    row.next().next().next().set(1241.43125412515151);
    row.next().next().next().next().set("yolo");
    
    cout << "size " << row.size() << endl;
    cout << "data " << row.get() << endl;
    cout << "data " << row.next().get() << endl;
    cout << "data " << row.next().next().get() << endl;
    cout << "data " << row.next().next().next().get() << endl;
    
    cout << "_______________________\n";
    row.save(stdout);
    cout << endl;
    row.save(stdout,ID);
    cout << endl;
    row.save(stdout,OK);
    cout << endl;
    row.save(stdout,LETTER);
    cout << endl;
    row.save(stdout,DECIMAL);
    cout << endl;
    row.save(stdout,VARCHAR);
    cout << endl;
    row.save(stdout,STILLOK);
    cout << endl;
    cout << "_______________________\n";

//    row.load(stdin);
    
    cout << "_______________________\n";
    for (int i=0;i<6;i++)
    {
        row.save(stdout, i);
        cout <<endl;
    }

    cout << "_______________________\n";
    

    return 0;
}
