2015-09-15 20:16:58 -05:00
|
|
|
#include <iostream>
|
|
|
|
//#include "DBEngine.h"
|
|
|
|
#include <vector>
|
2015-09-15 21:38:49 -05:00
|
|
|
//#include "Attribute.h"
|
|
|
|
#include "Relation.h"
|
2015-09-15 20:16:58 -05:00
|
|
|
|
|
|
|
using namespace std;
|
2015-09-14 15:04:54 -05:00
|
|
|
|
|
|
|
int main() {
|
2015-09-15 20:16:58 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
DBEngine engine;
|
|
|
|
Relation r;
|
|
|
|
Attribute<int> a;
|
|
|
|
*/
|
|
|
|
|
|
|
|
vector<string> shamWow;
|
|
|
|
shamWow.push_back("rag");
|
|
|
|
shamWow.push_back("sponge");
|
|
|
|
shamWow.push_back("wooow");
|
|
|
|
shamWow.push_back("cloth");
|
|
|
|
|
|
|
|
Attribute atributo;
|
|
|
|
atributo.initializeAttribute("atributo",shamWow);
|
2015-09-15 21:38:49 -05:00
|
|
|
|
2015-09-15 20:16:58 -05:00
|
|
|
atributo.display();
|
|
|
|
|
|
|
|
vector<string> doom;
|
|
|
|
doom.push_back("zombieman");
|
|
|
|
doom.push_back("revenant");
|
|
|
|
doom.push_back("imp");
|
|
|
|
doom.push_back("archvile");
|
|
|
|
|
|
|
|
Attribute atributo2;
|
2015-09-15 21:38:49 -05:00
|
|
|
atributo2.initializeAttribute("atributo2",doom);
|
|
|
|
|
2015-09-15 20:16:58 -05:00
|
|
|
atributo2.display();
|
|
|
|
|
2015-09-15 21:38:49 -05:00
|
|
|
vector<Attribute> setOfAttributes;
|
|
|
|
setOfAttributes.push_back(atributo);
|
|
|
|
setOfAttributes.push_back(atributo2);
|
2015-09-15 20:16:58 -05:00
|
|
|
|
2015-09-15 21:38:49 -05:00
|
|
|
vector<string> attNames;
|
|
|
|
attNames.push_back("attName1");
|
|
|
|
attNames.push_back("attName2");
|
2015-09-15 20:16:58 -05:00
|
|
|
|
2015-09-15 21:38:49 -05:00
|
|
|
Relation myLittleRelation;
|
|
|
|
myLittleRelation.initializeRelation("randomName", attNames, setOfAttributes);
|
2015-09-15 20:16:58 -05:00
|
|
|
|
|
|
|
|
2015-09-15 21:38:49 -05:00
|
|
|
//adding tuple business-----------------------
|
2015-09-15 20:16:58 -05:00
|
|
|
|
2015-09-15 21:38:49 -05:00
|
|
|
vector<string> tuple;
|
|
|
|
tuple.push_back("hadoken");
|
|
|
|
tuple.push_back("soryuken");
|
2015-09-15 20:16:58 -05:00
|
|
|
|
2015-09-15 21:38:49 -05:00
|
|
|
myLittleRelation.addTuple(tuple);
|
|
|
|
|
|
|
|
myLittleRelation.display();
|
|
|
|
|
|
|
|
string input_query = "atributo";
|
|
|
|
cout << "\nThe attempted input query is: " << input_query << endl;
|
|
|
|
|
|
|
|
myLittleRelation.projectQuery(input_query);
|
2015-09-15 20:16:58 -05:00
|
|
|
}
|