9 #ifndef ThePEG_LoopGuard_H
10 #define ThePEG_LoopGuard_H
26 template <
typename ExceptionT = Exception,
27 typename MessageT =
const char *>
37 LoopGuard(
const MessageT & mess,
long maxc = 1000000 )
94 template <
typename ExceptionT>
LoopGuard()
Default constructor is private and not implemented.
void operator()()
Increase the iteration count and throw an ExceptionT if the maximum number of iterations is exceeded...
This is the main namespace within which all identifiers in ThePEG are declared.
long maxCount
The maximum number of counts allowed.
long count
The number of counts so far.
void operator()()
Increase the iteration count and throw an ExceptionT if the maximum number of iterations is exceeded...
A LoopGuard object can be used to throw an exception if a loop is iterated too many times...
LoopGuard(long maxc=1000000)
Create a loop guard object which will throw an exception of type ExceptionT, constructed with 'mess' ...
long maxCount
The maximum number of counts allowed.
LoopGuard(const MessageT &mess, long maxc=1000000)
Create a loop guard object which will throw an exception of type ExceptionT, constructed with 'mess' ...
long count
The number of counts so far.
const MessageT & message
The message with which the thrown ExceptionT object will be initialized.