Overpass API regression suite coverage (Saxony) / template_db/transaction.h
template_db/transaction.h
38 of 40 instrumented lines run by the suite (95.0%) at 8edf11b0419c (this file on GitHub).
runnever runcolumns: line, executions, queries (click for the queries that run the line)
1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.2 *3 * This file is part of Overpass_API.4 *5 * Overpass_API is free software: you can redistribute it and/or modify6 * it under the terms of the GNU Affero General Public License as7 * published by the Free Software Foundation, either version 3 of the8 * License, or (at your option) any later version.9 *10 * Overpass_API is distributed in the hope that it will be useful,11 * but WITHOUT ANY WARRANTY; without even the implied warranty of12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * GNU General Public License for more details.14 *15 * You should have received a copy of the GNU Affero General Public License16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.17 */19#ifndef DE__OSM3S___TEMPLATE_DB__TRANSACTION_H20#define DE__OSM3S___TEMPLATE_DB__TRANSACTION_H22#include "random_file.h"24#include <signal.h>26#include <map>27#include <vector>30class Transaction31{32 public:34 virtual File_Blocks_Index_Base* data_index(const File_Properties*) = 0;35 virtual Random_File_Index* random_index(const File_Properties*) = 0;36 virtual std::string get_db_dir() const = 0;37};40class Nonsynced_Transaction : public Transaction41{42 public:43 Nonsynced_Transaction(44 Access_Mode access_mode, bool use_shadow, const std::string& db_dir, const std::string& file_name_extension);45 virtual ~Nonsynced_Transaction();47 File_Blocks_Index_Base* data_index(const File_Properties*);48 Random_File_Index* random_index(const File_Properties*);50 void flush();53 private:54 std::map< const File_Properties*, File_Blocks_Index_Base* >55 data_files;56 std::map< const File_Properties*, Random_File_Index* >57 random_files;58 Access_Mode access_mode;59 bool use_shadow;60 std::string file_name_extension, db_dir;61};64inline Nonsynced_Transaction::Nonsynced_Transaction(65 Access_Mode access_mode_, bool use_shadow_,66 const std::string& db_dir_, const std::string& file_name_extension_)76inline Nonsynced_Transaction::~Nonsynced_Transaction()82inline void Nonsynced_Transaction::flush()95inline File_Blocks_Index_Base* Nonsynced_Transaction::data_index96 (const File_Properties* fp)1038592668 q File_Blocks_Index_Base* data_index = fp->new_data_index(access_mode, use_shadow, db_dir, file_name_extension);110inline Random_File_Index* Nonsynced_Transaction::random_index(const File_Properties* fp)117563228 q random_files[fp] = new Random_File_Index(*fp, access_mode, use_shadow, db_dir, file_name_extension);122#endif