33 lines
No EOL
981 B
C++
Executable file
33 lines
No EOL
981 B
C++
Executable file
#pragma once
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "Attribute.h"
|
|
|
|
class Relation{
|
|
string name;
|
|
vector<Attribute> att;
|
|
int size;
|
|
|
|
public:
|
|
Relation(string n);
|
|
Relation(string n, vector<Attribute> a);
|
|
void insertAttributes(vector<Attribute> a);
|
|
string getTableName();
|
|
void setTableName(string s);
|
|
Attribute operator[](int i);
|
|
vector<string> getTuple(int index);
|
|
vector<Attribute> getAttributes();
|
|
void setAttributes(vector<Attribute> v);
|
|
vector<string> getAttributeNames();
|
|
Attribute& getAttributeByName(string s);
|
|
bool isAttribute(string s);
|
|
void renameAttribute(string oldstr, string newstr);
|
|
int getSize();
|
|
void display();
|
|
void insertTuple(vector<string> tuple); //assuming they are in order
|
|
void updateTuple(vector<string> tuple, int index); //assuming they are in order
|
|
void insertFromRelation(Relation r);
|
|
void removeTuple(int index);
|
|
void removeFromTuple(int rindex, int aindex);
|
|
void updateInAttribute(string val, int attIndex, int index);
|
|
}; |