casacore
|
MeasTableMul provides thread-safe access to time-dependent multiplier matrices. More...
#include <MeasTableMul.h>
Public Member Functions | |
MeasTableMul () | |
virtual | ~MeasTableMul () |
void | clear () |
CountedPtr< Matrix< Double > > | getArray (Double time, Double epsilon) |
virtual void | init ()=0 |
virtual void | calc (Matrix< Double > &, Double time)=0 |
Protected Attributes | |
std::mutex | itsMutex |
Int64 | itsLastUsed |
std::vector< Int64 > | itsUsed |
std::vector< Double > | itsTimes |
std::vector< CountedPtr < Matrix< Double > > > | itsArrays |
Matrix< Double > | itsDefArray |
MeasTableMul provides thread-safe access to time-dependent multiplier matrices.
Internal
MeasTableMul is a helper class for MeasTable to provide thread-safe access to the various multiplier matrices for nutation, aberration, and solar position. These matrices are dependent on the epoch.
It is an abstract base class for specific derived classes dealing with the various effects. This base class provides a cache to keep the matrices for various epochs alive. The idea is that a program will process epochs in order, where multiple threads can handle different epochs.
When the cache is full, the least recently used entry is replaced by the new matrix.
The cache does not hold Matrix
objects themselves, but a CountedPtr<Matrix>
to avoid that in one thread a Matrix is removed from the cache, while another thread is still using that Matrix. This assumes that CountedPtr is compiled thread-safe.
The class provides two virtual functions.
init
is called on the first access and makes it possible for the derived class to precompute some variables. In particular, itsDefMatrix
should be filled with default values. calc
is called on each access and should return the matrix valid for the given epoch. Prior to calling this function, the class will copy itsDefMatrix
to the result which also defines the shape of the result. Note that this function is only called if the matrix for the given epoch is not in the cache. Class MeasTable shows how it is used.
Definition at line 91 of file MeasTableMul.h.
casacore::MeasTableMul::MeasTableMul | ( | ) |
|
inlinevirtual |
Definition at line 95 of file MeasTableMul.h.
Implemented in casacore::MeasTableMulPosEarthZ, casacore::MeasTableMulPosEarthXY, casacore::MeasTableMulPosSunZ, casacore::MeasTableMulPosSunXY, casacore::MeasTableMulAber1950, casacore::MeasTableMulAber, casacore::MeasTableMulSC2000B, casacore::MeasTableMulSC2000A, casacore::MeasTableMulSC1950, and casacore::MeasTableMulSC.
void casacore::MeasTableMul::clear | ( | ) |
CountedPtr<Matrix<Double> > casacore::MeasTableMul::getArray | ( | Double | time, |
Double | epsilon | ||
) |
|
pure virtual |
Implemented in casacore::MeasTableMulPosEarthZ, casacore::MeasTableMulPosEarthXY, casacore::MeasTableMulPosSunZ, casacore::MeasTableMulPosSunXY, casacore::MeasTableMulAber1950, casacore::MeasTableMulAber, casacore::MeasTableMulSC2000B, casacore::MeasTableMulSC2000A, casacore::MeasTableMulSC1950, and casacore::MeasTableMulSC.
|
protected |
Definition at line 105 of file MeasTableMul.h.
Definition at line 106 of file MeasTableMul.h.
|
protected |
Definition at line 102 of file MeasTableMul.h.
|
protected |
Definition at line 101 of file MeasTableMul.h.
|
protected |
Definition at line 104 of file MeasTableMul.h.
|
protected |
Definition at line 103 of file MeasTableMul.h.