SwatDB
Loading...
Searching...
No Matches
indexfile.h
Go to the documentation of this file.
1/*
2 * SwatDB
3 *
4 * @authors: See Contributors.doc for code contributors
5 *
6 * Copyright (c) 2020 Swarthmore College Computer Science Department
7 * Swarthmore PA, Professors Tia Newhall, Ameet Soni
8 */
9
10#ifndef _SWATDB_INDEXFILE_H_
11#define _SWATDB_INDEXFILE_H_
12
13
18#include<vector>
19#include <utility>
20#include <string>
21#include "swatdb_types.h"
22#include "file.h" //for inheritance
23
24class Key;
25
29class IndexFile;
30class SearchKeyFormat;
31
32
41class IndexFile : public File {
42
43 public:
44
62 relation, std::vector<std::string> field_list);
80 relation, std::vector<FieldId> field_list);
81
87 virtual ~IndexFile(){}
88
95
103 virtual void insertEntry(Key key, RecordId record_id) = 0;
104
110 virtual std::vector<RecordId> getEntries(Key key) = 0;
111
119 virtual void deleteEntry(Key key, RecordId record_id) = 0;
120
126 virtual void deleteKey(Key key) = 0;
127
128 protected:
129
134
139
140};
141
142
143#endif
Definition bufmgr.h:121
Definition catalog.h:161
Definition file.h:45
Catalog * catalog
Definition file.h:124
BufferManager * buf_mgr
Definition file.h:129
Definition indexfile.h:41
virtual void deleteEntry(Key key, RecordId record_id)=0
A virtual method for deleting an entry of the given Key and RecordId.
virtual ~IndexFile()
Destructor. Data members are cleaned up, but none of the dynamically allocated data members are delet...
Definition indexfile.h:87
IndexFile(Catalog *catalog, BufferManager *buf_mgr, FileId relation, std::vector< std::string > field_list)
Constructor for IndexFile class.
SearchKeyFormat * getKeyFormat()
Returns the key format of the Index.
virtual std::vector< RecordId > getEntries(Key key)=0
A virtual method for getting a list of entries with the given key.
SearchKeyFormat * key_format
Definition indexfile.h:138
IndexFile(Catalog *catalog, BufferManager *buf_mgr, FileId relation, std::vector< FieldId > field_list)
Constructor for IndexFile class.
virtual void deleteKey(Key key)=0
A virtual method for deleting all entires with the given key.
FileId relation
Definition indexfile.h:133
virtual void insertEntry(Key key, RecordId record_id)=0
A virtual method for inserting a <Key, RecordId> entry into the IndexFile.
Definition key.h:38
Definition searchkeyformat.h:32
Definition swatdb_types.h:70
std::uint32_t FileId
Definition swatdb_types.h:33