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/Relation.h

33 lines
981 B
C
Raw Permalink Normal View History

2015-09-24 20:02:57 -05:00
#pragma once
2015-09-15 20:17:52 -05:00
#include <iostream>
#include <vector>
#include "Attribute.h"
2015-09-17 18:30:45 -05:00
class Relation{
string name;
2015-09-15 21:37:11 -05:00
vector<Attribute> att;
2015-09-15 22:20:14 -05:00
int size;
2015-09-15 20:17:52 -05:00
public:
2015-09-17 18:30:45 -05:00
Relation(string n);
Relation(string n, vector<Attribute> a);
2015-09-23 16:34:15 -05:00
void insertAttributes(vector<Attribute> a);
2015-09-17 18:30:45 -05:00
string getTableName();
2015-09-26 07:09:44 -05:00
void setTableName(string s);
2015-09-24 20:02:57 -05:00
Attribute operator[](int i);
2015-09-24 20:42:59 -05:00
vector<string> getTuple(int index);
2015-09-17 18:30:45 -05:00
vector<Attribute> getAttributes();
2015-10-05 16:50:19 -05:00
void setAttributes(vector<Attribute> v);
2015-09-17 18:30:45 -05:00
vector<string> getAttributeNames();
2015-09-22 09:03:42 -05:00
Attribute& getAttributeByName(string s);
bool isAttribute(string s);
2015-09-22 09:03:42 -05:00
void renameAttribute(string oldstr, string newstr);
2015-09-17 18:30:45 -05:00
int getSize();
void display();
2015-09-22 21:17:45 -05:00
void insertTuple(vector<string> tuple); //assuming they are in order
2015-10-06 19:10:48 -05:00
void updateTuple(vector<string> tuple, int index); //assuming they are in order
2015-09-21 16:27:23 -05:00
void insertFromRelation(Relation r);
2015-09-24 21:15:12 -05:00
void removeTuple(int index);
void removeFromTuple(int rindex, int aindex);
2015-10-06 23:19:53 -05:00
void updateInAttribute(string val, int attIndex, int index);
2015-09-17 18:34:03 -05:00
};