WSL/SLF GitLab Repository

Commit cadb2f21 authored by Thomas Egger's avatar Thomas Egger
Browse files

IOManager: added the option to clear the point cache through the clear_cache()...

IOManager: added the option to clear the point cache through the clear_cache() procedure. Furthermore the point cache is cleared in case push_meteo_data is successful, i.e. when data (filtered or raw) is pushed into the IOManager. 
parent c01093d0
......@@ -132,6 +132,8 @@ void IOManager::push_meteo_data(const ProcessingLevel& level, const Date& date_s
} else {
throw InvalidArgumentException("The processing level is invalid (should be raw OR filtered)", AT);
}
point_cache.clear(); //clear point cache, so that we don't return resampled values of deprecated data
}
size_t IOManager::getStationData(const Date& date, STATIONS_SET& vecStation)
......@@ -244,6 +246,11 @@ void IOManager::add_to_cache(const Date& i_date, const METEO_SET& vecMeteo)
point_cache[i_date] = vecMeteo;
}
void IOManager::clear_cache()
{
point_cache.clear();
}
size_t IOManager::getTrueMeteoData(const Date& i_date, METEO_SET& vecMeteo)
{
vecMeteo.clear();
......
......@@ -197,8 +197,21 @@ class IOManager {
const std::string toString() const;
/**
* @brief Add a METEO_SET for a specific instance to the point cache. This is a way to manipulate
* MeteoData variables and be sure that the manipulated values are later used for requests
* regarding that specific date (e.g. 2D interpolations)
*
* @param i_date Representing a point in time
* @param vecMeteo A vector of MeteoData objects to be copied into the point cache
*/
void add_to_cache(const Date& i_date, const METEO_SET& vecMeteo);
/**
* @brief Clear the point cache. All resampled values are dismissed, will need to be recalculated.
*/
void clear_cache();
private:
void initVirtualStations();
void fill_filtered_cache();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment