This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/Condition.cpp

60 lines
1.1 KiB
C++
Raw Normal View History

2015-09-23 16:34:15 -05:00
#include <iostream>
#include "Attribute.h"
2015-09-24 20:02:57 -05:00
#include "Relation.h"
2015-09-23 16:34:15 -05:00
using namespace std;
2015-09-24 20:02:57 -05:00
Relation equality(string attName, string s, Relation r){
Attribute att = r.getAttributeByName(attName);
vector<Attribute> r_atts = r.getAttributes();
vector<Attribute> new_atts = r_atts;
for (int i = 0; i < new_atts.size(); ++i) {
new_atts[i].clearAllValues();
}
for (int i = 0; i < att.getSize(); ++i) {
if (att[i] == s){
for (int j = 0; j < r_atts.size(); ++j){
new_atts[j].addCell(r_atts[j][i]);
}
}
}
2015-09-23 17:10:09 -05:00
2015-09-24 20:02:57 -05:00
//currently all returned relations are called TEMP
Relation new_r("TEMP", new_atts);
return new_r;
2015-09-23 16:34:15 -05:00
}
2015-09-24 20:02:57 -05:00
/*
vector<Attribute> equality(Attribute a, int i){
for (int i = 0; i < a.getSize(); ++i) {
//
}
2015-09-23 16:34:15 -05:00
}
2015-09-24 20:02:57 -05:00
vector<Attribute> gt(Attribute a, int i){
for (int i = 0; i < a.getSize(); ++i) {
//
}
2015-09-23 16:34:15 -05:00
}
2015-09-24 20:02:57 -05:00
vector<Attribute> lt(Attribute a, int i){
for (int i = 0; i < a.getSize(); ++i) {
//
}
2015-09-23 16:34:15 -05:00
}
2015-09-24 20:02:57 -05:00
vector<Attribute> gte(Attribute a, int i){
for (int i = 0; i < a.getSize(); ++i) {
//
}
2015-09-23 16:34:15 -05:00
}
2015-09-24 20:02:57 -05:00
vector<Attribute> lte(Attribute a, int i){
for (int i = 0; i < a.getSize(); ++i) {
//
}
}
2015-09-24 20:49:49 -05:00
*/