Column Store
SchemaMetaData.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <assert.h>
4 
5 #include <unordered_map>
6 #include <vector>
7 
8 #include "Projection.h"
9 #include "Table.h"
10 
11 namespace Parser {
12 using std::unordered_map;
13 
15  vector<Table> tables;
16  unordered_map<string, int> table_map;
17  vector<Projection> projections;
18  unordered_map<string, int> projection_map;
19 
20  public:
21  void add_table(Table table) {
22  table_map[table.get_table_name()] = tables.size();
23  tables.push_back(table);
24  }
25  void add_projection(Projection projection) {
26  projection_map[projection.get_projection_name()] = projections.size();
27  projections.push_back(projection);
28  }
29  vector<Table> &get_tables() { return tables; }
30  Table &get_table(string table_name);
31  vector<Projection> &get_projections() { return projections; }
32  Projection &get_projection(string projection_name);
33 
34 };
35 } // namespace Parser
Parser::SchemaMetaData::projection_map
unordered_map< string, int > projection_map
Definition: SchemaMetaData.h:18
Table.h
SchemaMetaData.h
Parser::SchemaMetaData
Definition: SchemaMetaData.h:14
Parser::SchemaMetaData::get_table
Table & get_table(string table_name)
Definition: SchemaMetaData.cpp:5
main
int main()
Definition: SchemaLoaderTester.cpp:8
Parser
Definition: Column.h:6
Parser::SchemaLoader
Definition: SchemaLoader.h:13
Parser::SchemaMetaData::add_projection
void add_projection(Projection projection)
Definition: SchemaMetaData.h:25
Parser::Table::get_table_name
std::string get_table_name()
Definition: Table.h:38
Parser::Projection
Definition: Projection.h:44
Parser::SchemaMetaData::table_map
unordered_map< string, int > table_map
Definition: SchemaMetaData.h:16
Parser::SchemaMetaData::tables
vector< Table > tables
Definition: SchemaMetaData.h:15
Parser::SchemaMetaData::projections
vector< Projection > projections
Definition: SchemaMetaData.h:17
Parser::Projection::get_projection_name
std::string get_projection_name()
Definition: Projection.h:65
Parser::ProjectionNotFoundException
Definition: Projection.h:18
Parser::SchemaMetaData::get_projection
Projection & get_projection(string projection_name)
Definition: SchemaMetaData.cpp:13
Parser::TableNotFoundException
Definition: Table.h:16
Parser::SchemaExtractor::get_meta_data
SchemaMetaData get_meta_data()
Definition: SchemaExtractor.h:24
SchemaLoader.h
Parser::SchemaMetaData::get_projections
vector< Projection > & get_projections()
Definition: SchemaMetaData.h:31
Parser::Table
Definition: Table.h:25
Parser::SchemaExtractor
Definition: SchemaExtractor.h:14
Parser::DataLoader
Definition: DataLoader.h:9
Projection.h
Parser::SchemaMetaData::get_tables
vector< Table > & get_tables()
Definition: SchemaMetaData.h:29
DataLoader.h
Parser::SchemaMetaData::add_table
void add_table(Table table)
Definition: SchemaMetaData.h:21