thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
ThePEG::CurrentGenerator Class Reference

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.
 
EventGeneratoroperator* () const
 Return a reference to the currently chosen object.
 
EventGeneratoroperator-> () 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 EventGeneratorcurrent ()
 Return a reference to the currently chosen EventGenerator object.
 
static EventGeneratorptr ()
 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. More...
 
static ostream & out ()
 Get the current standard output stream. More...
 
static ostream & log ()
 Get the current standard log stream. More...
 
static ostream & ref ()
 Get the current standard ref stream. More...
 
template<typename T >
static Ptr< T >::pointer getPtr (const T &t)
 Get object. More...
 
static IBPtr getPointer (string name)
 Get object. More...
 
template<typename T >
static Ptr< T >::pointer getObject (string name)
 Get object. More...
 
template<typename T >
static Ptr< T >::pointer getDefault ()
 Get default object. More...
 

Private Member Functions

CurrentGeneratoroperator= (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< EGPtrtheGeneratorStack
 The stack of EventGenerators requested.
 

Detailed Description

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.

See also
EventGenerator

Definition at line 33 of file CurrentGenerator.h.

Member Function Documentation

◆ getDefault()

template<typename T >
static Ptr<T>::pointer ThePEG::CurrentGenerator::getDefault ( )
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().

◆ getObject()

template<typename T >
static Ptr<T>::pointer ThePEG::CurrentGenerator::getObject ( string  name)
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().

◆ getPointer()

static IBPtr ThePEG::CurrentGenerator::getPointer ( string  name)
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().

◆ getPtr()

template<typename T >
static Ptr<T>::pointer ThePEG::CurrentGenerator::getPtr ( const T &  t)
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().

◆ log()

static ostream& ThePEG::CurrentGenerator::log ( )
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().

◆ out()

static ostream& ThePEG::CurrentGenerator::out ( )
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().

◆ ref()

static ostream& ThePEG::CurrentGenerator::ref ( )
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().

◆ strategy()

static tStrategyPtr ThePEG::CurrentGenerator::strategy ( )
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().


The documentation for this class was generated from the following file: