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

#include <G4UIaliasList.hh>

Public Member Functions

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

Detailed Description

Definition at line 42 of file G4UIaliasList.hh.

Constructor & Destructor Documentation

◆ G4UIaliasList()

G4UIaliasList::G4UIaliasList ( )

Definition at line 35 of file G4UIaliasList.cc.

35{}

◆ ~G4UIaliasList()

G4UIaliasList::~G4UIaliasList ( )

Definition at line 38 of file G4UIaliasList.cc.

39{
40 G4int n_treeEntry = alias.size();
41 for(G4int i = 0; i < n_treeEntry; ++i)
42 {
43 delete alias[i];
44 delete value[i];
45 }
46}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ ChangeAlias()

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

Definition at line 90 of file G4UIaliasList.cc.

91{
92 G4int i = FindAliasID(aliasName);
93 if(i < 0)
94 {
95 AddNewAlias(aliasName, aliasValue);
96 return;
97 }
98 *(value[i]) = aliasValue;
99}

Referenced by G4UImanager::SetAlias().

◆ FindAlias()

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

Definition at line 102 of file G4UIaliasList.cc.

103{
104 G4int i = FindAliasID(aliasName);
105 if(i < 0)
106 {
107 return 0;
108 }
109 return value[i];
110}

Referenced by G4UImanager::SolveAlias().

◆ List()

void G4UIaliasList::List ( )

Definition at line 125 of file G4UIaliasList.cc.

126{
127 G4int i_entry = alias.size();
128 for(G4int i1 = 0; i1 < i_entry - 1; ++i1)
129 for(G4int i2 = i1 + 1; i2 < i_entry; ++i2)
130 {
131 if(*(alias[i1]) > *(alias[i2]))
132 {
133 G4String* tmp = alias[i1];
134 alias[i1] = alias[i2];
135 alias[i2] = tmp;
136 tmp = value[i1];
137 value[i1] = value[i2];
138 value[i2] = tmp;
139 }
140 }
141
142 for(G4int i = 0; i < i_entry; ++i)
143 {
144 G4cout << " " << *(alias[i]) << " : " << *(value[i]) << G4endl;
145 }
146}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

Referenced by G4UImanager::ListAlias().

◆ RemoveAlias()

void G4UIaliasList::RemoveAlias ( const char *  aliasName)

Definition at line 76 of file G4UIaliasList.cc.

77{
78 G4int i = FindAliasID(aliasName);
79 if(i < 0)
80 {
81 G4cerr << "Alias <" << aliasName << "> does not exist. Command ignored."
82 << G4endl;
83 return;
84 }
85 alias.erase(alias.begin() + i);
86 value.erase(value.begin() + i);
87}
G4GLOB_DLL std::ostream G4cerr

Referenced by G4UImanager::RemoveAlias().


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