Geant4-11
Public Member Functions | Protected Types | Protected Attributes
G4ProcessVector Class Reference

#include <G4ProcessVector.hh>

Public Member Functions

void clear ()
 
G4bool contains (G4VProcess *aProcess) const
 
std::size_t entries () const
 
 G4ProcessVector ()
 
 G4ProcessVector (const G4ProcessVector &)
 
 G4ProcessVector (std::size_t)
 
std::size_t index (G4VProcess *aProcess) const
 
G4bool insert (G4VProcess *aProcess)
 
G4bool insertAt (G4int i, G4VProcess *aProcess)
 
std::size_t length () const
 
G4VProcess *& operator() (G4int i)
 
G4VProcess *const & operator() (G4int i) const
 
G4ProcessVectoroperator= (const G4ProcessVector &right)
 
G4bool operator== (const G4ProcessVector &right) const
 
G4VProcess *& operator[] (G4int i)
 
G4VProcess *const & operator[] (G4int i) const
 
G4VProcessremoveAt (G4int i)
 
G4VProcessremoveLast ()
 
std::size_t size () const
 
virtual ~G4ProcessVector ()
 

Protected Types

using G4ProcVector = std::vector< G4VProcess * >
 

Protected Attributes

G4ProcVectorpProcVector = nullptr
 

Detailed Description

Definition at line 44 of file G4ProcessVector.hh.

Member Typedef Documentation

◆ G4ProcVector

using G4ProcessVector::G4ProcVector = std::vector<G4VProcess*>
protected

Definition at line 98 of file G4ProcessVector.hh.

Constructor & Destructor Documentation

◆ G4ProcessVector() [1/3]

G4ProcessVector::G4ProcessVector ( )

Definition at line 37 of file G4ProcessVector.cc.

38{
40}
G4ProcVector * pProcVector
std::vector< G4VProcess * > G4ProcVector

References pProcVector.

◆ G4ProcessVector() [2/3]

G4ProcessVector::G4ProcessVector ( std::size_t  siz)
explicit

Definition at line 42 of file G4ProcessVector.cc.

43{
44 pProcVector = new G4ProcVector(siz);
45}

References pProcVector.

◆ G4ProcessVector() [3/3]

G4ProcessVector::G4ProcessVector ( const G4ProcessVector right)

Definition at line 47 of file G4ProcessVector.cc.

48 : pProcVector(nullptr)
49{
51
52 // copy all contents in pProcVector
53 //
54 for (auto i=right.pProcVector->cbegin(); i!=right.pProcVector->cend(); ++i)
55 {
56 pProcVector->push_back(*i);
57 }
58}

References pProcVector.

◆ ~G4ProcessVector()

G4ProcessVector::~G4ProcessVector ( )
virtual

Definition at line 63 of file G4ProcessVector.cc.

64{
65 // delete pProcVector
66 //
67 if (pProcVector != nullptr )
68 {
69 pProcVector->clear();
70 delete pProcVector;
71 }
72}

References pProcVector.

Member Function Documentation

◆ clear()

void G4ProcessVector::clear ( )
inline

◆ contains()

G4bool G4ProcessVector::contains ( G4VProcess aProcess) const

Definition at line 114 of file G4ProcessVector.cc.

115{
116 for (auto it=pProcVector->cbegin();it!=pProcVector->cend(); ++it)
117 {
118 if (*(*it)==*aProcess) return true;
119 }
120 return false;
121}

References pProcVector.

Referenced by G4GlobalFastSimulationManager::ShowSetup().

◆ entries()

std::size_t G4ProcessVector::entries ( ) const
inline

◆ index()

std::size_t G4ProcessVector::index ( G4VProcess aProcess) const

Definition at line 102 of file G4ProcessVector.cc.

103{
104 std::size_t j=0;
105 for (auto it=pProcVector->cbegin();it!=pProcVector->cend(); ++j, ++it)
106 {
107 if (*(*it)==*aProcess) return j;
108 }
109 return -1;
110}

References pProcVector.

◆ insert()

G4bool G4ProcessVector::insert ( G4VProcess aProcess)
inline

◆ insertAt()

G4bool G4ProcessVector::insertAt ( G4int  i,
G4VProcess aProcess 
)

Definition at line 125 of file G4ProcessVector.cc.

126{
127 if ( (i<0) || (i>G4int(pProcVector->size())) ) return false;
128 if (i==G4int(pProcVector->size()))
129 {
130 pProcVector->push_back(aProcess);
131 }
132 else
133 {
134 auto it=pProcVector->cbegin();
135 for(G4int j=0; j!=i; ++j) ++it;
136 pProcVector->insert(it, aProcess);
137 }
138 return true;
139}
int G4int
Definition: G4Types.hh:85

References pProcVector.

Referenced by G4ProcessManager::InsertAt().

◆ length()

std::size_t G4ProcessVector::length ( ) const
inline

◆ operator()() [1/2]

G4VProcess *& G4ProcessVector::operator() ( G4int  i)
inline

◆ operator()() [2/2]

G4VProcess *const & G4ProcessVector::operator() ( G4int  i) const
inline

◆ operator=()

G4ProcessVector & G4ProcessVector::operator= ( const G4ProcessVector right)

Definition at line 77 of file G4ProcessVector.cc.

78{
79 if (this != &right)
80 {
81 // delete pProcVector
82 if (pProcVector != nullptr )
83 {
84 pProcVector->clear();
85 delete pProcVector;
86 }
87
89
90 // copy all contents in pProcVector
91 //
92 for (auto i=right.pProcVector->cbegin(); i!=right.pProcVector->cend(); ++i)
93 {
94 pProcVector->push_back(*i);
95 }
96 }
97 return *this;
98}

References pProcVector.

◆ operator==()

G4bool G4ProcessVector::operator== ( const G4ProcessVector right) const
inline

◆ operator[]() [1/2]

G4VProcess *& G4ProcessVector::operator[] ( G4int  i)
inline

◆ operator[]() [2/2]

G4VProcess *const & G4ProcessVector::operator[] ( G4int  i) const
inline

◆ removeAt()

G4VProcess * G4ProcessVector::removeAt ( G4int  i)

Definition at line 143 of file G4ProcessVector.cc.

144{
145 auto it=pProcVector->cbegin();
146 for(std::size_t j=0; j<pProcVector->size() && G4int(j)<i; ++j) ++it;
147 G4VProcess* rValue = *it;
148 pProcVector->erase(it);
149 return rValue;
150}

References pProcVector.

Referenced by G4ProcessManager::RemoveAt(), and G4ProcessManager::RemoveProcess().

◆ removeLast()

G4VProcess * G4ProcessVector::removeLast ( )
inline

◆ size()

std::size_t G4ProcessVector::size ( ) const
inline

Referenced by G4BiasingHelper::ActivatePhysicsBiasing(), G4EmCalculator::ActiveForParticle(), G4ITStepProcessor::ActiveOnlyITProcess(), G4BiasingHelper::AddLimiterProcess(), G4hImpactIonisation::AlongStepDoIt(), RunAction::BeginOfRunAction(), G4VUserChemistryList::BuildPhysicsTable(), G4VUserPhysicsList::BuildPhysicsTable(), G4LossTableManager::BuildTables(), G4PhysicsListHelper::CheckParticleList(), G4NeutronCrossSectionXS::ConstructProcess(), G4FastSimulationPhysics::ConstructProcess(), G4GenericBiasingPhysics::ConstructProcess(), G4TheRayTracer::CreateBitMap(), G4HadronicProcess::FillResult(), G4MuonicAtomDecay::FillResult(), G4PhysListUtil::FindCaptureProcess(), G4PhysListUtil::FindElasticProcess(), G4PhysListUtil::FindFissionProcess(), G4PhysListUtil::FindInelasticProcess(), G4EmCalculator::FindProcess(), G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget(), G4BiasingProcessInterface::IsFirstPostStepDoItInterface(), G4BiasingProcessInterface::IsFirstPostStepGPILInterface(), G4BiasingProcessInterface::IsLastPostStepDoItInterface(), G4BiasingProcessInterface::IsLastPostStepGPILInterface(), G4VEmProcess::PostStepDoIt(), G4VEnergyLossProcess::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4VEnergyLossProcess::PreparePhysicsTable(), G4VUserPhysicsList::PreparePhysicsTable(), G4PhysicsListHelper::RegisterProcess(), G4BiasingProcessInterface::ReorderBiasingVectorAsGPIL(), G4VUserPhysicsList::RetrievePhysicsTable(), G4RunManagerKernel::SetupShadowProcess(), G4WorkerRunManagerKernel::SetupShadowProcess(), G4WorkerTaskRunManagerKernel::SetupShadowProcess(), and G4VUserPhysicsList::StorePhysicsTable().

Field Documentation

◆ pProcVector

G4ProcVector* G4ProcessVector::pProcVector = nullptr
protected

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