39 G4int n_treeEntry = alias.size();
40 for( i=0; i < n_treeEntry; i++ )
47 return (
this == &right );
52 return (
this != &right );
55void G4UIaliasList::AddNewAlias(
const char* aliasName,
const char* aliasValue)
59 G4cerr <<
"Alias <" << aliasName <<
"> already exist. Command ignored."
64 alias.push_back(newAlias);
66 value.push_back(newValue);
71 G4int i = FindAliasID(aliasName);
74 G4cerr <<
"Alias <" << aliasName <<
"> does not exist. Command ignored."
78 alias.erase(alias.begin()+i);
79 value.erase(value.begin()+i);
84 G4int i = FindAliasID(aliasName);
87 AddNewAlias(aliasName,aliasValue);
90 *(value[i]) = aliasValue;
95 G4int i = FindAliasID(aliasName);
101G4int G4UIaliasList::FindAliasID(
const char* aliasName)
103 G4int i_entry = alias.size();
104 for(
G4int i=0;i<i_entry;i++)
105 {
if(*(alias[i])==aliasName)
return i; }
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++)
115 if(*(alias[i1])>*(alias[i2]))
118 alias[i1] = alias[i2];
121 value[i1] = value[i2];
126 for(
G4int i=0;i<i_entry;i++)
127 {
G4cout <<
" " << *(alias[i]) <<
" : " << *(value[i]) <<
G4endl; }
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4String * FindAlias(const char *aliasName)
void ChangeAlias(const char *aliasName, const char *aliasValue)
void RemoveAlias(const char *aliasName)