-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.h
More file actions
43 lines (38 loc) · 966 Bytes
/
Database.h
File metadata and controls
43 lines (38 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// Created by bashirov on 7/22/24.
//
#ifndef PROJECT3_DATABASE_H
#define PROJECT3_DATABASE_H
#pragma once
#include "Relation.h"
#include <map>
#include <set>
#include <memory>
#include <string>
using namespace std;
class Database {
private:
string _name;
map<string, Relation> relations;
public:
void Add(const string& name, Relation relation){
//relations[name] = relation;
relations.insert({name, relation});
}
void Add2(const string& name, Relation relation){
relations.at(name) = relation;
}
Relation getRelation (string name){
Relation relation = relations.at(name);
return relation;
}
// string toString() const {
// stringstream out;
// for (const auto &pair: relations) {
// out << pair.first;
// Relation relation = Relation(pair.second);
// out << relation.toString() << endl;
// }
// }
};
#endif //PROJECT3_DATABASE_H