DP3
ParmCache.h
Go to the documentation of this file.
1 // ParmCache.h: A class dealing with caching and handling ParmDB entries
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_PARMCACHE_H
11 #define LOFAR_PARMDB_PARMCACHE_H
12 
13 #include "ParmSet.h"
14 #include "ParmValue.h"
15 #include "AxisMapping.h"
16 
17 namespace dp3 {
18 namespace parmdb {
19 
20 class ParmDB;
21 
24 
26 
28 class ParmCache {
29  public:
34 
39  ParmCache(ParmSet&, const Box& workDomain);
40 
43  ParmSet& getParmSet() { return *itsParmSet; }
44  const ParmSet& getParmSet() const { return *itsParmSet; }
46 
48  void clear();
49 
52  void reset(const Box& workDomain);
53 
59  void cacheValues();
60 
63  ParmValueSet& getValueSet(ParmId parmid) { return itsValueSets[parmid]; }
64  const ParmValueSet& getValueSet(ParmId parmid) const {
65  return itsValueSets[parmid];
66  }
68 
70  AxisMappingCache& getAxisMappingCache() { return itsAxisCache; }
71 
77  void setSolveGrid(ParmId parmid, const Grid& solveGrid);
78 
81  void flush();
82 
83  private:
86  ParmCache(const ParmCache&);
87  ParmCache& operator=(const ParmCache&);
89 
90  ParmSet* itsParmSet;
91  Box itsWorkDomain;
92  std::vector<ParmValueSet> itsValueSets;
93  AxisMappingCache itsAxisCache;
94 };
95 
97 
98 } // namespace parmdb
99 } // namespace dp3
100 
101 #endif
Map the cells of one axis to another.
Set of parameters to be used.
A class containing the values of a parameter.
This class caches axis mappings. It uses the unique id of the from-axis and to-axis as the key in the...
Definition: AxisMapping.h:102
Class representing a 2-dim box.
Definition: Box.h:36
The envelope class for a 2-D grid with regular or irregular axes. -.
Definition: Grid.h:83
A class dealing with caching and handling ParmDB entries.
Definition: ParmCache.h:28
ParmCache(ParmSet &, const Box &workDomain)
void setSolveGrid(ParmId parmid, const Grid &solveGrid)
void clear()
Clear the cache.
const ParmSet & getParmSet() const
Definition: ParmCache.h:44
ParmSet & getParmSet()
Definition: ParmCache.h:43
AxisMappingCache & getAxisMappingCache()
Get the AxisMappingCache object.
Definition: ParmCache.h:70
const ParmValueSet & getValueSet(ParmId parmid) const
Definition: ParmCache.h:64
ParmValueSet & getValueSet(ParmId parmid)
Definition: ParmCache.h:63
void reset(const Box &workDomain)
Set of parameters to be used.
Definition: ParmSet.h:31
A class holding information of multiple domains of a parameter. ParmValueSet holds the information of...
Definition: ParmValue.h:146
unsigned int ParmId
Define the type of a parmId.
Definition: ParmSet.h:22
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53