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>

List of all members.

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.

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 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

CurrentGeneratoroperator= (const CurrentGenerator &)
 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.

Classes

class  Redirect
 Class used to temporarily redirect a given ostream to the misc() stream of the current EventGenerator. More...


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

static tStrategyPtr ThePEG::CurrentGenerator::strategy (  )  [inline, static]

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 96 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::strategy().

static ostream& ThePEG::CurrentGenerator::out (  )  [inline, static]

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 104 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::out().

static ostream& ThePEG::CurrentGenerator::log (  )  [inline, static]

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 112 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::log().

static ostream& ThePEG::CurrentGenerator::ref (  )  [inline, static]

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 120 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::ref().

template<typename T>
static Ptr<T>::pointer ThePEG::CurrentGenerator::getPtr ( const T &  t  )  [inline, static]

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 128 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::getPtr().

static IBPtr ThePEG::CurrentGenerator::getPointer ( string  name  )  [inline, static]

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 137 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::getPointer().

template<typename T>
static Ptr<T>::pointer ThePEG::CurrentGenerator::getObject ( string  name  )  [inline, static]

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 147 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::getObject().

template<typename T>
static Ptr<T>::pointer ThePEG::CurrentGenerator::getDefault (  )  [inline, static]

Get default object.

Return the default object for class T in the current EventGenerator. Returns the null pointer if non-existent.

Definition at line 156 of file CurrentGenerator.h.

References current(), and ThePEG::EventGenerator::getDefault().


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

Generated on Thu Apr 29 12:43:21 2010 for ThePEG by  doxygen 1.5.5