Geant4 9.6.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 43 of file G4UIaliasList.hh.

Constructor & Destructor Documentation

◆ G4UIaliasList()

G4UIaliasList::G4UIaliasList ( )

Definition at line 33 of file G4UIaliasList.cc.

34{ }

◆ ~G4UIaliasList()

G4UIaliasList::~G4UIaliasList ( )

Definition at line 36 of file G4UIaliasList.cc.

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

Member Function Documentation

◆ ChangeAlias()

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

Definition at line 82 of file G4UIaliasList.cc.

83{
84 G4int i = FindAliasID(aliasName);
85 if(i<0)
86 {
87 AddNewAlias(aliasName,aliasValue);
88 return;
89 }
90 *(value[i]) = aliasValue;
91}

Referenced by G4UImanager::SetAlias().

◆ FindAlias()

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

Definition at line 93 of file G4UIaliasList.cc.

94{
95 G4int i = FindAliasID(aliasName);
96 if(i<0)
97 { return 0; }
98 return value[i];
99}

Referenced by G4UImanager::SolveAlias().

◆ List()

void G4UIaliasList::List ( )

Definition at line 109 of file G4UIaliasList.cc.

110{
111 G4int i_entry = alias.size();
112 for(G4int i1=0;i1<i_entry-1;i1++)
113 for(G4int i2=i1+1;i2<i_entry;i2++)
114 {
115 if(*(alias[i1])>*(alias[i2]))
116 {
117 G4String* tmp = alias[i1];
118 alias[i1] = alias[i2];
119 alias[i2] = tmp;
120 tmp = value[i1];
121 value[i1] = value[i2];
122 value[i2] = tmp;
123 }
124 }
125
126 for(G4int i=0;i<i_entry;i++)
127 { G4cout << " " << *(alias[i]) << " : " << *(value[i]) << G4endl; }
128}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by G4UImanager::ListAlias().

◆ RemoveAlias()

void G4UIaliasList::RemoveAlias ( const char *  aliasName)

Definition at line 69 of file G4UIaliasList.cc.

70{
71 G4int i = FindAliasID(aliasName);
72 if(i<0)
73 {
74 G4cerr << "Alias <" << aliasName << "> does not exist. Command ignored."
75 << G4endl;
76 return;
77 }
78 alias.erase(alias.begin()+i);
79 value.erase(value.begin()+i);
80}
G4DLLIMPORT std::ostream G4cerr

Referenced by G4UImanager::RemoveAlias().


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