DP3
ParmDBLocker.h
Go to the documentation of this file.
1 // ParmDBLocker.h: Class to hold a read or write lock on ParmDBs
2 //
3 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 
9 
10 #ifndef LOFAR_PARMDB_PARMDBLOCKER_H
11 #define LOFAR_PARMDB_PARMDBLOCKER_H
12 
13 #include <memory>
14 #include <vector>
15 
16 namespace dp3 {
17 namespace parmdb {
18 
19 class ParmSet;
20 class ParmDB;
21 
24 
26 
31 class ParmDBLocker {
32  public:
34  typedef std::shared_ptr<ParmDBLocker> ShPtr;
35 
37  explicit ParmDBLocker(const ParmSet& parmSet, bool write = false);
38 
40  explicit ParmDBLocker(ParmDB& parmdb, bool write = false);
41 
44 
45  private:
48  ParmDBLocker(const ParmDBLocker&);
49  ParmDBLocker& operator=(const ParmDBLocker&);
51 
53  std::vector<ParmDB*> itsDBs;
54 };
55 
57 
58 } // namespace parmdb
59 } // namespace dp3
60 
61 #endif
Class to hold a read or write lock on ParmDBs.
Definition: ParmDBLocker.h:31
ParmDBLocker(ParmDB &parmdb, bool write=false)
Create a lock on a specific ParmDB.
~ParmDBLocker()
The destructor unlocks the ParmDBs locked by the constructor.
ParmDBLocker(const ParmSet &parmSet, bool write=false)
Create a read or write lock on all ParmDBs in the ParmSet.
std::shared_ptr< ParmDBLocker > ShPtr
Define a shared pointer for this type.
Definition: ParmDBLocker.h:34
Envelope class for a table holding parameters.
Definition: ParmDB.h:159
Set of parameters to be used.
Definition: ParmSet.h:31
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53