DP3
Public Member Functions | List of all members
dp3::parmdb::AxisCache Class Reference

This class caches Grid objects. More...

#include <AxisMapping.h>

Public Member Functions

void clear ()
 Clear the cache. More...
 
Axis::ShPtr getAxis (const Axis &axis)
 
Grid getGrid (const std::vector< Box > &domains)
 

Detailed Description

This class caches Grid objects.

It is used to achieve that parameters with equal domains share the same Axis objects. In this way the AxisMapping objects can also be shared which can improve the performance. The cache consists of two parts:

  1. A map of axis ID to Axis objects is used to know which Axis objects are available and to find them by Axis ID.
  2. Another map is used to find the possible pair of Axis objects that form a Grid with a given hash value. Note that different Grids might map to the same hash value, although in practice that will hardly ever occur.

Member Function Documentation

◆ clear()

void dp3::parmdb::AxisCache::clear ( )
inline

Clear the cache.

◆ getAxis()

Axis::ShPtr dp3::parmdb::AxisCache::getAxis ( const Axis axis)

Test if an Axis object equal to the given one occurs in the cache. If so, return that object. Otherwise add the Axis to the cache.

◆ getGrid()

Grid dp3::parmdb::AxisCache::getGrid ( const std::vector< Box > &  domains)

Get a Grid object for the given domains. It adds Axis objects to the cache if they are new.


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