SwatDB
Loading...
Searching...
No Matches
searchkeyformat.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_SEARCHKEYFORMAT_H_
11#define _SWATDB_SEARCHKEYFORMAT_H_
12
13
14
19#include <vector>
20#include "swatdb_types.h"
21
30class Schema;
31
33
34 friend class Key;
35 friend class Record;
36
37 public:
41 SearchKeyFormat() = delete;
42
46 SearchKeyFormat& operator=(const SearchKeyFormat& other) = delete;
47
48
55 SearchKeyFormat(std::vector<std::string> field_list, Schema* schema);
56
63 SearchKeyFormat(std::vector<FieldId> field_list, Schema* schema);
64
69
70
74 void saveToFile(std::ofstream *out_file);
75
79 void initFromFile(std::ifstream *in_file);
80
84 std::vector<FieldId> getFieldList();
85
86 private:
90 std::vector<FieldId> field_list;
91
96
97};
98
99#endif
Definition key.h:38
Definition record.h:34
Definition schema.h:37
Definition searchkeyformat.h:32
std::vector< FieldId > getFieldList()
returns the vector list corresponding to the field list
SearchKeyFormat(std::vector< std::string > field_list, Schema *schema)
Constructor of SearchKeyFormat.
std::vector< FieldId > field_list
Definition searchkeyformat.h:90
void saveToFile(std::ofstream *out_file)
outputs fieldids in field list to out file passed in by pointer.
void initFromFile(std::ifstream *in_file)
initializes fieldids based on saved metadata
~SearchKeyFormat()
Destructor.
Definition searchkeyformat.h:68
SearchKeyFormat & operator=(const SearchKeyFormat &other)=delete
Disable copy assignment constructor.
SearchKeyFormat()=delete
Disable default Constructor.
Schema * schema
Definition searchkeyformat.h:95
SearchKeyFormat(std::vector< FieldId > field_list, Schema *schema)
Constructor of SearchKeyFormat.