SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
UpdateDBConnection.py
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 import ctypes
10 from ctypes import POINTER
11 from SQLamarr import clib, c_TransformerPtr
12 
13 from SQLamarr.db_functions import SQLite3DB
14 
15 clib.new_UpdateDBConnection.argtypes = (ctypes.c_void_p,)
16 clib.new_UpdateDBConnection.restype = c_TransformerPtr
17 
19  """
20  Update the reference to the DB Connection, to ensure synchronization with disk.
21 
22  Refer to SQLamarr::UpdateDBConnection for implementation details.
23  """
24  def __init__ (self, db: SQLite3DB):
25  """
26  Configure a Transformer to update the connection to the DB.
27 
28  @param db: An open database connection.
29  """
30  self._self_self = clib.new_UpdateDBConnection(db.get(), db.path.encode('ascii'))
31 
32  def __del__(self):
33  """@private: Release the bound class instance"""
34  clib.del_Transformer(self._self_self)
35 
36  @property
37  def raw_pointer(self):
38  """@private: Return the raw pointer to the algorithm."""
39  return self._self_self
40 
41 
42 
43 
Update the reference to the DB Connection, to ensure synchronization with disk.
def __init__(self, SQLite3DB db)
Configure a Transformer to update the connection to the DB.