BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
BDSAperturePointsCache Class Reference

A holder for loaded aperture points files. More...

#include <BDSAperturePointsLoader.hh>

Collaboration diagram for BDSAperturePointsCache:
Collaboration graph

Public Member Functions

void ClearCachedFiles ()
 Delete all cached points from memory and clear the map of files loaded. More...
 
std::vector< G4TwoVector > * FindCachedFile (const G4String &fileNameAndUnits) const
 Retrieve a cached files. Will return nullptr if not found. More...
 
void CacheFile (const G4String &fileNameAndUnits, std::vector< G4TwoVector > *contents)
 Add an entry to the cache. More...
 

Static Public Member Functions

static BDSAperturePointsCacheInstance ()
 Access the singleton instance. More...
 

Private Attributes

std::map< G4String, std::vector< G4TwoVector > * > cachedFiles
 

Static Private Attributes

static BDSAperturePointsCacheinstance = nullptr
 

Detailed Description

A holder for loaded aperture points files.

This is a separate class from the loader as the loader is templated and this would result in a different cache for each format loaded.

Singleton.

Author
Laurie Nevay

Definition at line 67 of file BDSAperturePointsLoader.hh.

Constructor & Destructor Documentation

◆ ~BDSAperturePointsCache()

BDSAperturePointsCache::~BDSAperturePointsCache ( )

Definition at line 188 of file BDSAperturePointsLoader.cc.

Member Function Documentation

◆ CacheFile()

void BDSAperturePointsCache::CacheFile ( const G4String &  fileNameAndUnits,
std::vector< G4TwoVector > *  contents 
)

Add an entry to the cache.

Definition at line 210 of file BDSAperturePointsLoader.cc.

Referenced by BDS::LoadAperturePoints().

Here is the caller graph for this function:

◆ ClearCachedFiles()

void BDSAperturePointsCache::ClearCachedFiles ( )

Delete all cached points from memory and clear the map of files loaded.

Definition at line 193 of file BDSAperturePointsLoader.cc.

Referenced by BDSIM::~BDSIM(), and BDSIMLink::~BDSIMLink().

Here is the caller graph for this function:

◆ FindCachedFile()

std::vector< G4TwoVector > * BDSAperturePointsCache::FindCachedFile ( const G4String &  fileNameAndUnits) const

Retrieve a cached files. Will return nullptr if not found.

Definition at line 200 of file BDSAperturePointsLoader.cc.

Referenced by BDS::LoadAperturePoints().

Here is the caller graph for this function:

◆ Instance()

BDSAperturePointsCache * BDSAperturePointsCache::Instance ( )
static

Access the singleton instance.

Definition at line 181 of file BDSAperturePointsLoader.cc.

Referenced by BDS::LoadAperturePoints(), BDSIM::~BDSIM(), and BDSIMLink::~BDSIMLink().

Here is the caller graph for this function:

Field Documentation

◆ cachedFiles

std::map<G4String, std::vector<G4TwoVector>*> BDSAperturePointsCache::cachedFiles
private

Definition at line 90 of file BDSAperturePointsLoader.hh.

◆ instance

BDSAperturePointsCache * BDSAperturePointsCache::instance = nullptr
staticprivate

Definition at line 88 of file BDSAperturePointsLoader.hh.


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