Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ( )

Definition at line 33 of file G4UIaliasList.cc.

34 { }
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:78
const XML_Char int const XML_Char * value
Definition: expat.h:331

Member Function Documentation

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 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

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 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

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 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
Definition: expat.h:331
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

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 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

Here is the caller graph for this function:


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