#include #include #include #include #include "PHelpers.h" using namespace std; PAttribute::PAttribute(){ name = "~"; type = "~"; key = false; size = 0; } PAttribute::PAttribute(string str, string t){ name = str; type = t; key = false; size = 0; } PAttribute::PAttribute(string str, string t, int s){ name = str; type = t; key = false; size = s; } PUnion::PUnion(){ Un1 = "~"; Un2 = "~"; } PUnion::PUnion(string s1, string s2){ Un1 = s1; Un2 = s2; } string PUnion::getPUnion(){ return "Union of " + Un1 + " and " + Un2; } PProduct::PProduct(){ Pr1 = "~"; Pr2 = "~"; } PProduct::PProduct(string s1, string s2){ Pr1 = s1; Pr2 = s2; } string PProduct::getPProduct(){ return "Product of " + Pr1 + " and " + Pr2; } PDifference::PDifference(){ D1 = "~"; D2 = "~"; } PDifference::PDifference(string s1, string s2){ D1 = s1; D2 = s2; } string PDifference::getPDifference(){ return "Difference of " + D1 + " and " + D2; } PRenaming::PRenaming(){ newName = "~"; oldName = "~"; } PRenaming::PRenaming(string s1, string s2){ newName = s1; oldName = s2; } string PRenaming::doRename(){ return "Renaming " + oldName + " to " + newName; } PProjection::PProjection(){ newName = "~"; oldName = "~"; } PProjection::PProjection(string s1, string s2){ newName = s1; oldName = s2; } string PProjection::doPProjection(){ return "Projecting " + oldName + " onto " + newName; } PComparison::PComparison(){ op.setPOp("~"); operand1.setPOperand("~"); operand2.setPOperand("~"); } PComparison::PComparison(string str1, string str2, string str3){ operand1.setPOperand(str1); op.setPOp(str2); operand2.setPOperand(str3); } void PComparison::setPComparison(string str1, string str2, string str3){ operand1.setPOperand(str1); op.setPOp(str2); operand2.setPOperand(str3); } string PComparison::getPComparison(){ return operand1.getPOperand() + " " + op.getPOp() + " " + operand2.getPOperand(); }