Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UIaliasList Class Reference

#include <G4UIaliasList.hh>

Public Member Functions

void ChangeAlias (const char *aliasName, const char *aliasValue)
 
void RemoveAlias (const char *aliasName)
 
const G4StringFindAlias (const char *aliasName) const
 
void List () const
 

Detailed Description

Definition at line 42 of file G4UIaliasList.hh.

Member Function Documentation

◆ ChangeAlias()

void G4UIaliasList::ChangeAlias ( const char * aliasName,
const char * aliasValue )

Definition at line 56 of file G4UIaliasList.cc.

57{
58 if (FindAlias(aliasName) == nullptr) {
59 AddNewAlias(aliasName, aliasValue);
60 return;
61 }
62 aliases[aliasName] = aliasValue;
63}
const G4String * FindAlias(const char *aliasName) const

Referenced by G4UImanager::SetAlias().

◆ FindAlias()

const G4String * G4UIaliasList::FindAlias ( const char * aliasName) const

Definition at line 66 of file G4UIaliasList.cc.

67{
68 auto it = aliases.find(aliasName);
69 return (it == aliases.end()) ? nullptr : &(it->second);
70}

Referenced by ChangeAlias(), RemoveAlias(), and G4UImanager::SolveAlias().

◆ List()

void G4UIaliasList::List ( ) const

Definition at line 73 of file G4UIaliasList.cc.

74{
75 // Aliases are already sorted by std::less<G4String>
76 for (const auto& [a, v] : aliases) {
77 G4cout << " " << a << " : " << v << G4endl;
78 }
79}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by G4UImanager::ListAlias().

◆ RemoveAlias()

void G4UIaliasList::RemoveAlias ( const char * aliasName)

Definition at line 46 of file G4UIaliasList.cc.

47{
48 if (FindAlias(aliasName) == nullptr) {
49 G4cerr << "Alias <" << aliasName << "> does not exist. Command ignored." << G4endl;
50 return;
51 }
52 aliases.erase(aliasName);
53}
G4GLOB_DLL std::ostream G4cerr

Referenced by G4UImanager::RemoveAlias().


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