ThePEG 2.3.0
|
This CurrentGenerator class keeps a static stack of EventGenerators which can be used anywhere by any class. More...
#include <CurrentGenerator.h>
Classes | |
class | Redirect |
Class used to temporarily redirect a given ostream to the misc() stream of the current EventGenerator. More... | |
Public Member Functions | |
CurrentGenerator () | |
Default constructor does nothing. | |
CurrentGenerator (const CurrentGenerator &) | |
Copy-constructor does nothing. | |
CurrentGenerator (const EGPtr &eg) | |
Construct a new object specifying a new EventGenerator, eg, to be used during this objects lifetime. | |
~CurrentGenerator () | |
The destructor removing the EventGenerator specified in the constructor from the stack. | |
EventGenerator & | operator* () const |
Return a reference to the currently chosen object. | |
EventGenerator * | operator-> () const |
Return a pointer to the currently chosen object. | |
operator bool () const | |
Test for existance. | |
bool | operator! () const |
Test for existance. | |
Static Public Member Functions | |
static bool | isVoid () |
Returns true if there is no currently chosen EventGenerator object. | |
static EventGenerator & | current () |
Return a reference to the currently chosen EventGenerator object. | |
static EventGenerator * | ptr () |
Pointer to the stack. | |
static tSMPtr | standardModel () |
Return a pointer to the standard model parameters used by the current generator. | |
static tStrategyPtr | strategy () |
Return a pointer to the strategy object containing eg. | |
static ostream & | out () |
Get the current standard output stream. | |
static ostream & | log () |
Get the current standard log stream. | |
static ostream & | ref () |
Get the current standard ref stream. | |
template<typename T > | |
static Ptr< T >::pointer | getPtr (const T &t) |
Get object. | |
static IBPtr | getPointer (string name) |
Get object. | |
template<typename T > | |
static Ptr< T >::pointer | getObject (string name) |
Get object. | |
template<typename T > | |
static Ptr< T >::pointer | getDefault () |
Get default object. | |
Private Member Functions | |
CurrentGenerator & | operator= (const CurrentGenerator &)=delete |
Private and non-existent assignment operator. | |
Private Attributes | |
bool | generatorPushed |
True if this object is responsible for pushing a EventGenerator onto the stack. | |
Static Private Attributes | |
static vector< EGPtr > | theGeneratorStack |
The stack of EventGenerators requested. | |
This CurrentGenerator class keeps a static stack of EventGenerators which can be used anywhere by any class.
When an EventGenerator is initialized or run it adds itself to the stack which can be used by any other object being initialized or run through the static functions of the CurrentGenerator class. If someone needs to use an alternative EventGenerator object a new CurrentGenerator object can be constructed with a pointer to the desired EventGenerator object as argument and that object will the be used by the static CurrentGenerator functions until the CurrentGenerator object is destructed.
Definition at line 33 of file CurrentGenerator.h.
|
inline |
Default constructor does nothing.
Definition at line 40 of file CurrentGenerator.h.
|
inline |
Copy-constructor does nothing.
Definition at line 45 of file CurrentGenerator.h.
|
inline |
Construct a new object specifying a new EventGenerator, eg, to be used during this objects lifetime.
Definition at line 52 of file CurrentGenerator.h.
References generatorPushed, and theGeneratorStack.
|
inline |
The destructor removing the EventGenerator specified in the constructor from the stack.
Definition at line 63 of file CurrentGenerator.h.
References generatorPushed, and theGeneratorStack.
|
inlinestatic |
Return a reference to the currently chosen EventGenerator object.
Definition at line 80 of file CurrentGenerator.h.
References theGeneratorStack.
Referenced by getDefault(), getObject(), getPointer(), getPtr(), log(), out(), ThePEG::CurrentGenerator::Redirect::Redirect(), ref(), standardModel(), strategy(), and ThePEG::Throw< Ex >::writeWarning().
|
inlinestatic |
Get default object.
Return the default object for class T in the current EventGenerator. Returns the null pointer if non-existent.
Definition at line 191 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::getDefault().
|
inlinestatic |
Get object.
Return a pointer to an object of type T present in the current EventGenerator given its full name. Return the null pointer if non-existent.
Definition at line 182 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::getObject().
|
inlinestatic |
Get object.
Return a pointer to an object present in the current EventGenerator given its full name. Return the null pointer if non-existent.
Definition at line 172 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::getPointer().
|
inlinestatic |
Get object.
Return a garbage collected pointer to a given object in the current EventGenerator. If the object is not found, a null pointer will be returned.
Definition at line 163 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::getPtr().
|
inlinestatic |
Returns true if there is no currently chosen EventGenerator object.
Definition at line 73 of file CurrentGenerator.h.
References theGeneratorStack.
Referenced by ThePEG::Throw< Ex >::writeWarning().
|
inlinestatic |
Get the current standard log stream.
Return a reference to the stream connected to the file for logging information of the current generator. If no file is connected, the BaseRepository::clog() will be used instead.
Definition at line 147 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::log().
|
inline |
|
inline |
|
inline |
Return a reference to the currently chosen object.
Definition at line 87 of file CurrentGenerator.h.
References theGeneratorStack.
|
inline |
Return a pointer to the currently chosen object.
Definition at line 94 of file CurrentGenerator.h.
References theGeneratorStack.
|
inlinestatic |
Get the current standard output stream.
Return a reference to the stream connected to the file for general output of the current generator. If no file is connected, the BaseRepository::cout() will be used instead.
Definition at line 139 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::out().
|
inlinestatic |
Pointer to the stack.
Definition at line 101 of file CurrentGenerator.h.
References theGeneratorStack.
Referenced by operator bool(), and operator!().
|
inlinestatic |
Get the current standard ref stream.
Return a reference to the stream connected to the file for references from used objects of the current generator. If no file is connected, the BaseRepository::cout() will be used instead.
Definition at line 155 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::ref().
|
inlinestatic |
Return a pointer to the standard model parameters used by the current generator.
Definition at line 123 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::standardModel().
|
inlinestatic |
Return a pointer to the strategy object containing eg.
a set of non-default particles to be used by the current generator.
Definition at line 131 of file CurrentGenerator.h.
References current(), and ThePEG::EventGenerator::strategy().
|
private |
True if this object is responsible for pushing a EventGenerator onto the stack.
Definition at line 265 of file CurrentGenerator.h.
Referenced by CurrentGenerator(), and ~CurrentGenerator().
|
staticprivate |
The stack of EventGenerators requested.
Definition at line 259 of file CurrentGenerator.h.
Referenced by current(), CurrentGenerator(), isVoid(), operator*(), operator->(), ptr(), and ~CurrentGenerator().