Message: Confusing code change in 10.0 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Confusing code change in 10.0 

Forum: Installation and Configuration
Date: 14 Aug, 2014
From: Tom Roberts <Tom Roberts>

This used to work, to add an instance of a class derived from G4VProcess to all particles:
   G4ParticleTable::G4PTblDicIterator *theParticleIterator =
                        G4ParticleTable::GetParticleTable()->GetIterator();
   theParticleIterator->reset();
   while((*theParticleIterator)()) {
       G4ParticleDefinition *pd = theParticleIterator->value();
       G4ProcessManager *pmgr = pd->GetProcessManager();
       if(!pmgr) continue;
       pmgr->AddProcess(this,ordDefault,-1,ordDefault);
   }

In 10.0 it fails because "theParticleIterator" is now a macro. This appears to be related to multi-threading (which I do not use).

Is it sufficient to simply change the name of my iterator, or is more needed?

What is the proper way to do this?

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Confusing code change in 10.0   (Joseph Perl - 14 Aug, 2014)
 Add Message Add Message
to: "Confusing code change in 10.0"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]