|
BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
custom key class for pair of <name,rigidity>. More...
#include <BDSAcceleratorComponentRegistry.hh>

Public Member Functions | |
| ACRegistryKey (const std::string &componentNameIn, G4double rigidityIn) | |
| ACRegistryKey (const ACRegistryKey &other)=default | |
| bool | operator== (const ACRegistryKey &other) const |
Data Fields | |
| std::string | componentName |
| Has to be std::string for hashing as G4String doesn't provide one. | |
| G4double | rigidity |
Static Public Attributes | |
| static G4double | tolerance = 1e-7 |
Friends | |
| std::ostream & | operator<< (std::ostream &out, ACRegistryKey const &k) |
custom key class for pair of <name,rigidity>.
We want to store a map of (name,rigidity) but compare rigidity with a numerical tolerance as it's a double. std::map requires the less than operator so we'll use unordered_map that uses ==.
This class is a pair but with == specialised. Also, we provide a hash function (specialisation for the template).
Definition at line 45 of file BDSAcceleratorComponentRegistry.hh.
| ACRegistryKey::ACRegistryKey | ( | ) |
Definition at line 40 of file BDSAcceleratorComponentRegistry.cc.
| ACRegistryKey::ACRegistryKey | ( | const std::string & | componentNameIn, |
| G4double | rigidityIn | ||
| ) |
Definition at line 45 of file BDSAcceleratorComponentRegistry.cc.
| bool ACRegistryKey::operator== | ( | const ACRegistryKey & | other | ) | const |
Definition at line 51 of file BDSAcceleratorComponentRegistry.cc.
|
friend |
Definition at line 58 of file BDSAcceleratorComponentRegistry.cc.
| std::string ACRegistryKey::componentName |
Has to be std::string for hashing as G4String doesn't provide one.
Definition at line 55 of file BDSAcceleratorComponentRegistry.hh.
Referenced by std::hash< ACRegistryKey >::operator()().
| G4double ACRegistryKey::rigidity |
Definition at line 56 of file BDSAcceleratorComponentRegistry.hh.
|
static |
Definition at line 57 of file BDSAcceleratorComponentRegistry.hh.