-
Notifications
You must be signed in to change notification settings - Fork 0
/
AugmentedCatalog.h
65 lines (60 loc) · 2.04 KB
/
AugmentedCatalog.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "AugmentedRecord.h"
#include <stddef.h>
//#include <optional>
#include <list>
#include <set>
using namespace std;
template <typename T>
/**
* @brief Augmented catalogs as described in paper (refered to as A_v).
* Stores the augmented records of the data structure
*/
class AugmentedCatalog {
/**
* AF(listOfRecords) = the catalog which holds the augmented records in the order
* specified in listOfRecords
*/
private:
AugmentedRecord* bottom_record = NULL;
int size = 0;
public:
// //TODO: Change this to an optional object
// /**
// * @brief Searches for a record in the catalog by key
// * @param key
// * @return Record<T> the record if found, and nullptr if not
// */
// AugmentedRecord search(int key) {
// for (AugmentedRecord record : this->listOfRecords) {
// // CHANGE THIS TO SETOFRECORDS IF WE USE THAT REP
// if (record.getKey() == key) {
// return record;
// }
// }
// return;
// };
void setBottomRecord(AugmentedRecord* bottomRecord) {
this->bottom_record = bottomRecord;
size++;
}
AugmentedRecord* getBottomRecord() {
return this->bottom_record;
}
int getSize() {
return size;
}
// AugmentedCatalog(list<AugmentedRecord> records) {
// records.sort();
// AugmentedRecord prev_record = records.front();
// records.pop_front();
// AugmentedRecord curr_record = records.front();
// while (records.size() != 0) {
// prev_record.setUpPointer(&curr_record);
// curr_record.setDownPointer(&prev_record);
// listOfRecords.push_back(prev_record);
// prev_record = curr_record;
// curr_record = records.front();
// records.pop_front();
// }
// }
};