OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::input::MultiColumnFileCache Class Reference

Per-resolve-pass cache keyed by resolved path. More...

#include <MultiColumnSeriesFile.hpp>

Collaboration diagram for openswmm::input::MultiColumnFileCache:

Public Member Functions

const ParsedSeriesFile * get_or_parse (const std::string &abs_path, std::vector< std::string > &errors, SeriesFileStatus *status=nullptr)
 Borrow a path-keyed parsed result, caching normal failure as well as success.
 
int parse_count () const noexcept
 Read this cache's normal parse-attempt count.
 

Detailed Description

Per-resolve-pass cache keyed by resolved path.

One instance is shared by the rain-gage and timeseries loaders so a file referenced by both parses once (plan ยง5 single-read guarantee). Failures are cached too, so N consumers of a broken file trigger one open attempt.

Member Function Documentation

◆ get_or_parse()

const ParsedSeriesFile * openswmm::input::MultiColumnFileCache::get_or_parse ( const std::string & abs_path,
std::vector< std::string > & errors,
SeriesFileStatus * status = nullptr )

Borrow a path-keyed parsed result, caching normal failure as well as success.

No file-change invalidation or internal synchronization. Caller shares one cache per resolve pass and copies selected data before that cache dies. Exceptions during parsing/insertion propagate and do not establish a normal cached result.

Parameters
[in]abs_pathBorrowed exact-byte cache key; no canonicalization or case folding. Equivalent filesystem spellings can create separate entries.
[in,out]errorsAppended file-level diagnostics only on first normal parse attempt for this exact key.
[out]statusOptional cached status destination.
Returns
Pointer into owned cache for OK, nullptr for cached failure; result remains valid across map rehashes until cache destruction.
Here is the call graph for this function:

◆ parse_count()

int openswmm::input::MultiColumnFileCache::parse_count ( ) const
inlinenoexcept

Read this cache's normal parse-attempt count.

Not an underlying OS-open counter; sniffing and thrown parse attempts are not included.

Returns
Number of parse calls that returned before cache insertion; failures count, cache hits do not.

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