#include <G4ITBox.hh>
Public Member Functions | |
G4ITBox () | |
~G4ITBox () | |
void | ResetStack () |
void | Push (G4IT *) |
void | Extract (G4IT *) |
G4IT * | FindIT (const G4Track &) |
const G4IT * | FindIT (const G4Track &) const |
void | TransferTo (G4ITBox *) |
G4bool | Empty () const |
G4int | GetNTrack () const |
G4IT * | GetFirstIT () |
G4IT * | GetLastIT () |
const G4IT * | GetFirstIT () const |
const G4IT * | GetLastIT () const |
void | SetNextBox (G4ITBox *box) |
G4ITBox * | GetNextBox () |
void | SetPreviousBox (G4ITBox *box) |
G4ITBox * | GetPreviousBox () |
Definition at line 50 of file G4ITBox.hh.
G4ITBox::G4ITBox | ( | ) |
G4ITBox::~G4ITBox | ( | ) |
Definition at line 41 of file G4ITBox.cc.
References G4IT::GetNext(), and SetNextBox().
00042 { 00043 if( fNbIT != 0 ) 00044 { 00045 G4IT * aIT = fpFirstIT; 00046 G4IT * nextIT; 00047 00048 while( aIT != 0 ) 00049 { 00050 nextIT = aIT->GetNext(); 00051 delete aIT; 00052 aIT = nextIT; 00053 } 00054 } 00055 00056 if(fpPreviousBox) fpPreviousBox->SetNextBox(fpNextBox) ; 00057 if(fpNextBox) fpNextBox->SetPreviousBox(fpPreviousBox); 00058 }
G4bool G4ITBox::Empty | ( | ) | const [inline] |
void G4ITBox::Extract | ( | G4IT * | ) |
Definition at line 87 of file G4ITBox.cc.
References G4IT::GetNext(), G4IT::GetPrevious(), G4IT::SetITBox(), G4IT::SetNext(), and G4IT::SetPrevious().
Referenced by G4IT::TakeOutBox(), and TransferTo().
00088 { 00089 if( aStackedIT == fpFirstIT ) 00090 { 00091 fpFirstIT = aStackedIT->GetNext(); 00092 } 00093 else if( aStackedIT == fpLastIT ) 00094 { 00095 fpLastIT = aStackedIT->GetPrevious(); 00096 00097 } 00098 00099 if( aStackedIT->GetNext()) 00100 aStackedIT->GetNext()->SetPrevious(aStackedIT->GetPrevious()); 00101 if( aStackedIT->GetPrevious()) 00102 aStackedIT->GetPrevious()->SetNext(aStackedIT->GetNext()); 00103 00104 aStackedIT->SetNext(0); 00105 aStackedIT->SetPrevious(0); 00106 aStackedIT->SetITBox(0); 00107 fNbIT--; 00108 }
Definition at line 130 of file G4ITBox.cc.
References G4IT::GetPrevious().
00131 { 00132 if( fNbIT == 0 ) return 0; 00133 00134 const G4IT * temp = fpLastIT; 00135 G4bool find = false; 00136 00137 while(find == false && temp != 0) 00138 { 00139 if(temp-> GetTrack() == &track) 00140 { 00141 find = true; 00142 break; 00143 } 00144 temp = temp->GetPrevious(); 00145 } 00146 00147 return temp; 00148 }
The FindIT methods are used for check only. Those methods are not effective due to the linear search. It is better to use GetIT(track) in order to retrieve the IT and GetIT(track)->GetBox() in order to check which is the box pointer.
Definition at line 110 of file G4ITBox.cc.
References G4IT::GetPrevious().
00111 { 00112 if( fNbIT == 0 ) return 0; 00113 00114 G4IT * temp = fpLastIT; 00115 G4bool find = false; 00116 00117 while(find == false && temp != 0) 00118 { 00119 if(temp-> GetTrack() == &track) 00120 { 00121 find = true; 00122 break; 00123 } 00124 temp = temp->GetPrevious(); 00125 } 00126 00127 return temp; 00128 }
const G4IT * G4ITBox::GetFirstIT | ( | ) | const [inline] |
G4IT * G4ITBox::GetFirstIT | ( | ) | [inline] |
Definition at line 104 of file G4ITBox.hh.
Referenced by G4VITManager::iterator::begin(), and G4VITManager::allbox_iterator::operator++().
const G4IT * G4ITBox::GetLastIT | ( | ) | const [inline] |
G4IT * G4ITBox::GetLastIT | ( | ) | [inline] |
G4ITBox * G4ITBox::GetNextBox | ( | ) | [inline] |
Definition at line 127 of file G4ITBox.hh.
Referenced by G4ITManager< T >::GetNextBox(), and G4VITManager::allbox_iterator::operator++().
G4int G4ITBox::GetNTrack | ( | ) | const [inline] |
G4ITBox * G4ITBox::GetPreviousBox | ( | ) | [inline] |
void G4ITBox::Push | ( | G4IT * | ) |
Definition at line 70 of file G4ITBox.cc.
References G4IT::SetITBox(), G4IT::SetNext(), and G4IT::SetPrevious().
Referenced by TransferTo().
00071 { 00072 if( fNbIT == 0 ) 00073 { 00074 aIT->SetPrevious( 0 ); 00075 fpFirstIT = aIT; 00076 } 00077 else 00078 { 00079 fpLastIT->SetNext( aIT ); 00080 aIT->SetPrevious( fpLastIT ); 00081 } 00082 fpLastIT = aIT; 00083 fNbIT++; 00084 aIT->SetITBox(this); 00085 }
void G4ITBox::ResetStack | ( | ) |
void G4ITBox::SetNextBox | ( | G4ITBox * | box | ) | [inline] |
void G4ITBox::SetPreviousBox | ( | G4ITBox * | box | ) | [inline] |
void G4ITBox::TransferTo | ( | G4ITBox * | ) |