SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
UpdateDBConnection.h
1 // (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration.
2 //
3 // This software is distributed under the terms of the GNU General Public
4 // Licence version 3 (GPL Version 3), copied verbatim in the file "LICENCE".
5 //
6 // In applying this licence, CERN does not waive the privileges and immunities
7 // granted to it by virtue of its status as an Intergovernmental Organization
8 // or submit itself to any jurisdiction.
9 
10 #pragma once
11 
12 // STL
13 #include <string>
14 
15 // SQLamarr
16 #include "SQLamarr/db_functions.h"
17 #include "SQLamarr/Transformer.h"
18 
19 namespace SQLamarr
20 {
31  {
32  public:
35  SQLite3DB& db,
37  std::string filename,
39  int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI
41  );
42 
43 
45  void execute () override;
46 
47  private: // members
48  SQLite3DB& m_database;
49  const std::string m_filename;
50  const int m_flags;
51  };
52 }
53 
54 
Interface to an executable class used for polymorphism.
Definition: Transformer.h:17
Update the reference to the DB Connection, to ensure synchronization with disk.
void execute() override
Execute the algorithm, cleaning the database.
UpdateDBConnection(SQLite3DB &db, std::string filename, int flags=SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_URI)
Constructor.
A database connection handler easying sharing the DB between C++ and Python.
Definition: db_functions.py:24