insert.cpp 1.08 KB
Newer Older
Philipp Götze's avatar
Philipp Götze committed
1
/*
2
 * Copyright (C) 2017-2019 DBIS Group - TU Ilmenau, All Rights Reserved.
Philipp Götze's avatar
Philipp Götze committed
3
 *
4
 * This file is part of our NVM-based Data Structures repository.
Philipp Götze's avatar
Philipp Götze committed
5
 *
6
7
8
 * This program is free software: you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
Philipp Götze's avatar
Philipp Götze committed
9
 *
10
11
12
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
Philipp Götze's avatar
Philipp Götze committed
13
 *
14
15
 * You should have received a copy of the GNU General Public License along with this program.
 * If not, see <http://www.gnu.org/licenses/>.
Philipp Götze's avatar
Philipp Götze committed
16
17
 */

18
#include "common.hpp"
Philipp Götze's avatar
Philipp Götze committed
19
20
21
22
23
24

using namespace dbis::ptable;

int main() {
  pool<root> pop;

25
  pmempool_rm(path.c_str(), 0);
Philipp Götze's avatar
Philipp Götze committed
26
27
28
29
30
31
32
33
34
  if (access(path.c_str(), F_OK) != 0) {
    insert(pop, path, NUM_TUPLES);
  } else {
    std::cerr << "Table already exists" << std::endl;
  }

  auto pTable = pop.root()->pTable;

  pop.close();
Philipp Götze's avatar
Philipp Götze committed
35
}