37 std::size_t n_treeEntry = alias.size();
38 for(std::size_t i = 0; i < n_treeEntry; ++i)
48 return (
this == &right);
54 return (
this != &right);
58void G4UIaliasList::AddNewAlias(
const char* aliasName,
const char* aliasValue)
62 G4cerr <<
"Alias <" << aliasName <<
"> already exists. Command ignored."
67 alias.push_back(newAlias);
69 value.push_back(newValue);
75 G4int i = FindAliasID(aliasName);
78 G4cerr <<
"Alias <" << aliasName <<
"> does not exist. Command ignored."
82 alias.erase(alias.begin() + i);
83 value.erase(value.begin() + i);
89 G4int i = FindAliasID(aliasName);
92 AddNewAlias(aliasName, aliasValue);
95 *(value[i]) = aliasValue;
101 G4int i = FindAliasID(aliasName);
110G4int G4UIaliasList::FindAliasID(
const char* aliasName)
112 std::size_t i_entry = alias.size();
113 for(std::size_t i = 0; i < i_entry; ++i)
115 if(*(alias[i]) == aliasName)
126 std::size_t i_entry = alias.size();
127 for(std::size_t i1 = 0; i1 < i_entry - 1; ++i1)
129 for(std::size_t i2 = i1 + 1; i2 < i_entry; ++i2)
131 if(*(alias[i1]) > *(alias[i2]))
134 alias[i1] = alias[i2];
137 value[i1] = value[i2];
143 for(std::size_t i = 0; i < i_entry; ++i)
145 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)