9 #ifndef ThePEG_Current_H
10 #define ThePEG_Current_H
114 operator bool()
const {
147 template <
typename T>
Current()
Default constructor does nothing.
~Current()
The destructor removing the object specified in the constructor from the stack.
Current(T *t)
Construct a new object specifying a new object, o, to be used during this objects lifetime...
static vector< T * > theStack
The stack of objects requested.
Current(const Current< T > &)
Copy-constructor does nothing.
The Current class keeps a static stack of objects of the templated class, which can be used anywhere ...
This is the main namespace within which all identifiers in ThePEG are declared.
bool operator!() const
Test for existance.
static bool isVoid()
Returns true if there is no currently chosen object.
static T & current()
Return a reference to the currently chosen object.
bool pushed
True if this object is responsible for pushing an object onto the stack.
T & operator*() const
Return a reference to the currently chosen object.
T * operator->() const
Return a pointer to the currently chosen object.
Current< T > & operator=(const Current< T > &)
Private and non-existent assignment operator.
static T * ptr()
Pointer to the stack.