class ThePEG::Current< T >
The Current class keeps a static stack of objects of the templated class, which can be used anywhere by any class.
When an object is active it adds itself to the stack which can be used by any other object through the static functions of the Current class. If someone needs to use an alternative object a new Current object can be constructed with a pointer to the desired object as argument and that object will the be used by the static Current functions until the Current object is destructed.
Default-contructed objects of the Current class can be used as a pointer to the currently chosen object on the stack.
The typical use case for this class is a handler class which uses a number of objects which do not have a reference back to the handler, but still need to acces some member functions. In a member function the handler class will construct a Current object:
Current<Handler> current(this); in any following function called in this member function, any object can then access the handlers methods as
Definition at line 39 of file Current.h.