40 G4int n_treeEntry = alias.size();
41 for(
G4int i = 0; i < n_treeEntry; ++i)
51 return (
this == &right);
57 return (
this != &right);
61void G4UIaliasList::AddNewAlias(
const char* aliasName,
const char* aliasValue)
65 G4cerr <<
"Alias <" << aliasName <<
"> already exists. Command ignored."
70 alias.push_back(newAlias);
72 value.push_back(newValue);
78 G4int i = FindAliasID(aliasName);
81 G4cerr <<
"Alias <" << aliasName <<
"> does not exist. Command ignored."
85 alias.erase(alias.begin() + i);
86 value.erase(value.begin() + i);
92 G4int i = FindAliasID(aliasName);
95 AddNewAlias(aliasName, aliasValue);
98 *(value[i]) = aliasValue;
104 G4int i = FindAliasID(aliasName);
113G4int G4UIaliasList::FindAliasID(
const char* aliasName)
115 G4int i_entry = alias.size();
116 for(
G4int i = 0; i < i_entry; ++i)
118 if(*(alias[i]) == aliasName)
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)
131 if(*(alias[i1]) > *(alias[i2]))
134 alias[i1] = alias[i2];
137 value[i1] = value[i2];
142 for(
G4int i = 0; i < i_entry; ++i)
144 G4cout <<
" " << *(alias[i]) <<
" : " << *(value[i]) <<
G4endl;
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4String * FindAlias(const char *aliasName)
void ChangeAlias(const char *aliasName, const char *aliasValue)
void RemoveAlias(const char *aliasName)