Changeset View
Changeset View
Standalone View
Standalone View
EvtGenBase/EvtParticle.hh
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | */ | ||||
double initializePhaseSpace( unsigned int numdaughter, EvtId* daughters, | double initializePhaseSpace( unsigned int numdaughter, EvtId* daughters, | ||||
bool forceResetMasses = false, | bool forceResetMasses = false, | ||||
double poleSize = -1., int whichTwo1 = 0, | double poleSize = -1., int whichTwo1 = 0, | ||||
int whichTwo2 = 1 ); | int whichTwo2 = 1 ); | ||||
/** | /** | ||||
* Get pointer the the i:th daugther. | * Get pointer the the i:th daugther. | ||||
*/ | */ | ||||
EvtParticle* getDaug( int i ); | EvtParticle* getDaug( const int i ) const; | ||||
tlatham: A const member function should not return a non-const pointer to a member since it allows the… | |||||
/** | /** | ||||
* Iterates over the particles in a decay chain. | * Iterates over the particles in a decay chain. | ||||
*/ | */ | ||||
EvtParticle* nextIter( EvtParticle* rootOfTree = 0 ); | EvtParticle* nextIter( EvtParticle* rootOfTree = 0 ); | ||||
/** | /** | ||||
* Makes stdhep list | * Makes stdhep list | ||||
▲ Show 20 Lines • Show All 316 Lines • Show Last 20 Lines |
A const member function should not return a non-const pointer to a member since it allows the client to subsequently modify the internal state. As such it is better to have two versions of the function, a const function that returns a const pointer and a non-const function that returns a non-const pointer.