Loading...
Searching...
No Matches
casacore::MeasTableMul Class Referenceabstract
measures package (libcasa_measures) » Measures_module » Measures_module_internal_classes

More...

`#include <MeasTableMul.h>`

## Public Member Functions

| MeasTableMul ()
virtual | ~MeasTableMul ()
void | clear ()
std::shared_ptr< 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< std::shared_ptr< Matrix< Double > > > | itsArrays
Matrix< Double > | itsDefArray

## Detailed Description

MeasTableMul provides thread-safe access to time-dependent multiplier matrices

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tMeasMath

### Synopsis

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 std::shared_ptr<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 std::shared_ptr 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.

### Example

Class MeasTable shows how it is used.

Definition at line 88 of file MeasTableMul.h.

## Constructor & Destructor Documentation

## MeasTableMul()

casacore::MeasTableMul::MeasTableMul | ( |  | ) |

## ~MeasTableMul()

virtual casacore::MeasTableMul::~MeasTableMul | ( |  | ) |

inline virtual

Definition at line 92 of file MeasTableMul.h.

## Member Function Documentation

## calc()

virtual void casacore::MeasTableMul::calc | ( | Matrix< Double > & | ,
|  | Double | time )

pure virtual

Implemented in casacore::MeasTableMulAber1950, casacore::MeasTableMulAber, casacore::MeasTableMulPosEarthXY, casacore::MeasTableMulPosEarthZ, casacore::MeasTableMulPosSunXY, casacore::MeasTableMulPosSunZ, casacore::MeasTableMulSC1950, casacore::MeasTableMulSC2000A, casacore::MeasTableMulSC2000B, and casacore::MeasTableMulSC.

References casacore::time().

## clear()

void casacore::MeasTableMul::clear | ( |  | ) |

## getArray()

std::shared_ptr< Matrix< Double > > casacore::MeasTableMul::getArray | ( | Double | time,
|  | Double | epsilon )

References casacore::time().

## init()

virtual void casacore::MeasTableMul::init | ( |  | ) |

pure virtual

Implemented in casacore::MeasTableMulAber1950, casacore::MeasTableMulAber, casacore::MeasTableMulPosEarthXY, casacore::MeasTableMulPosEarthZ, casacore::MeasTableMulPosSunXY, casacore::MeasTableMulPosSunZ, casacore::MeasTableMulSC1950, casacore::MeasTableMulSC2000A, casacore::MeasTableMulSC2000B, and casacore::MeasTableMulSC.

## Member Data Documentation

## itsArrays

std::vector<std::shared_ptr<Matrix<Double> > > casacore::MeasTableMul::itsArrays

protected

Definition at line 102 of file MeasTableMul.h.

## itsDefArray

Matrix<Double> casacore::MeasTableMul::itsDefArray

protected

Definition at line 103 of file MeasTableMul.h.

## itsLastUsed

Int64 casacore::MeasTableMul::itsLastUsed

protected

Definition at line 99 of file MeasTableMul.h.

## itsMutex

std::mutex casacore::MeasTableMul::itsMutex

protected

Definition at line 98 of file MeasTableMul.h.

## itsTimes

std::vector<Double> casacore::MeasTableMul::itsTimes

protected

Definition at line 101 of file MeasTableMul.h.

## itsUsed

std::vector<Int64> casacore::MeasTableMul::itsUsed

protected

Definition at line 100 of file MeasTableMul.h.

The documentation for this class was generated from the following file:

- measures/Measures/MeasTableMul.h