do not use template for index

This commit is contained in:
2021-12-18 11:10:18 +01:00
parent 7e8d750f63
commit 7a6a9e209a
4 changed files with 28 additions and 26 deletions

18
table.h
View File

@@ -43,22 +43,22 @@ struct Table {
void print();
std::string m_name;
std::string m_name;
std::vector<ColDefNode> m_col_defs;
std::vector<Row> m_rows;
std::vector<Index<IndexValue>> m_indexes;
std::vector<Row> m_rows;
std::vector<Index> m_indexes;
static long string_to_long(const std::string &s);
static double string_to_double(const std::string &s);
void create_row_from_vector(const std::vector<ColDefNode> &colDefs, const std::vector<std::string> &csv_line);
void create_index(const Index<IndexValue>& index);
void create_index(const Index& index);
bool drop_index(const std::string &index_name);
static void index_row(Index<IndexValue> &index, const ColDefNode &col_def, const Row &row, size_t rowid);
static void unindex_row(Index<IndexValue> &index, const ColDefNode &col_def, const Row &row, size_t rowid);
static void reindex_row(Index<IndexValue> &index, const ColDefNode &col_def, const Row &old_row, const Row &new_row, size_t rowid);
static void index_row(Index &index, const ColDefNode &col_def, const Row &row, size_t rowid);
static void unindex_row(Index &index, const ColDefNode &col_def, const Row &row, size_t rowid);
static void reindex_row(Index &index, const ColDefNode &col_def, const Row &old_row, const Row &new_row, size_t rowid);
void index_row(const Row &row);
void unindex_row(const Row &row);
@@ -66,8 +66,8 @@ struct Table {
void index_rows(const std::string &index_name);
Index<IndexValue> * get_index(const std::string &index_name);
Index<IndexValue> * get_index_for_column(const std::string &col_name);
Index * get_index(const std::string &index_name);
Index * get_index_for_column(const std::string &col_name);
struct rows_scanner {