SwatDB
swatdb.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 #pragma once
11 
12 #include "swatdb_types.h"
13 
18 class BufferManager;
19 class DiskManager;
20 class FileManager;
21 class Catalog;
22 class Schema;
23 
46 class SwatDB {
47 
48  public:
49 
56  SwatDB();
57 
73  SwatDB(std::string metadata_filename);
74 
91  ~SwatDB();
92 
93  // TODO: do we want version of destroyDB and saveDB that
94  // actually do the destroying and saving at other times
95  // in the execution rather than just set the state to
96  // do the right thing on shutdown???
107  void setDestroyDB();
108 
125  void setSaveDB(std::string filename);
126 
130  Catalog *getCatalog( ) { return cat; }
131 
136 
141 
146 
147  // TODO: do we want to export some information about the DB here
148  // statistics, sizes, etc.
149  // TODO: do we want any other interface functions that are
150  // called externally?
151 
152 
153  private: // or protected
154 
159 
164 
165 
170 
175 
182  bool saved;
183 
187  std::string inited_file_name;
188 
192  std::string saved_file_name;
193 };
SwatDB()
Constructor.
FileManager * getFileMgr()
Gets the SwatDB FileManager.
Definition: swatdb.h:145
void setDestroyDB()
sets the DB to be destroyed on shutdown.
Definition: schema.h:27
DiskManager * getDiskMgr()
Gets the SwatDB DiskManager.
Definition: swatdb.h:135
Definition: filemgr.h:31
bool saved
Definition: swatdb.h:182
void setSaveDB(std::string filename)
sets the DB to be saved on shutdown.
Definition: bufmgr.h:248
DiskManager * disk_mgr
Definition: swatdb.h:163
~SwatDB()
Shutdown SwatDB.
Catalog * cat
Definition: swatdb.h:158
FileManager * file_mgr
Definition: swatdb.h:174
BufferManager * getBufMgr()
Gets the SwatDB BufferManager.
Definition: swatdb.h:140
std::string inited_file_name
Definition: swatdb.h:187
BufferManager * buf_mgr
Definition: swatdb.h:169
Definition: diskmgr.h:36
Definition: catalog.h:134
std::string saved_file_name
Definition: swatdb.h:192
Definition: swatdb.h:46
Catalog * getCatalog()
Gets the SwatDB Catalog.
Definition: swatdb.h:130