ThePEG 2.3.0
|
HandlerGroup is a templated utility class to manage a group of StepHandler
s.
More...
#include <HandlerGroup.h>
Public Types | |
typedef Ptr< HDLR >::pointer | HdlPtr |
A pointer to the template argument class. | |
typedef Ptr< HDLR >::transient_pointer | tHdlPtr |
A transient pointer to the template argument class. | |
Public Types inherited from ThePEG::HandlerGroupBase | |
typedef pair< StepHdlPtr, HintPtr > | StepWithHint |
Associate a StepHandler with a Hint object. | |
typedef vector< StepHdlPtr > | StepVector |
A vector of StepHandler objects. | |
typedef vector< StepWithHint > | StepHintVector |
A vector of StepHandler objects associated with Hint objects. | |
typedef deque< HintPtr > | HintVector |
A vector of Hint objects. | |
Public Member Functions | |
virtual | ~HandlerGroup () |
Destructor. | |
virtual bool | setHandler (tStepHdlPtr, const HandlerGroupBase &ext) |
Set the current main handler. | |
virtual void | setHandler () |
Unset the current main handler. | |
virtual tStepHdlPtr | handler () const |
Return a pointer to the current main handler. | |
virtual tStepHdlPtr | defaultHandler () const |
Return a pointer to the default main handler. | |
virtual void | refillDefaultHandler (tStepHdlPtr) |
Set the current main handler. | |
virtual void | clear () |
Clear all current handlers, but don't touch the default ones. | |
virtual string | handlerClass () const |
Return the base class name of the main handler type. | |
void | interfaceSetHandler (HdlPtr) |
Utility function used for the interface. | |
HdlPtr | interfaceGetHandler () const |
Utility function used for the interface. | |
virtual void | write (PersistentOStream &os) const |
Write to persistent streams. | |
virtual void | read (PersistentIStream &is) |
Read from persistent streams. | |
Public Member Functions inherited from ThePEG::HandlerGroupBase | |
HandlerGroupBase () | |
Default constructor. | |
virtual | ~HandlerGroupBase () |
Destructor. | |
bool | empty () const |
Returns true if current selections in this group is empty. | |
void | init (const HandlerGroupBase &ext) |
Initialize, taking the default StepHandlers as the current ones, possibly overridden by the default ones in the auxilliary group supplied in the argument. | |
StepWithHint | next () |
Return the next step;. | |
void | addPreHandler (tStepHdlPtr sh, tHintPtr hint, const HandlerGroupBase &ext) |
Add a step handler, sh to the current list of pre-handlers. | |
void | addPostHandler (tStepHdlPtr sh, tHintPtr hint, const HandlerGroupBase &) |
Add a step handler, sh, to the current list of post-handlers. | |
void | addHint (tHintPtr hint, const HandlerGroupBase &ext) |
Add a hint to the currently selected main handler. | |
StepVector & | preHandlers () |
Return a reference to the list of default pre-handlers. | |
const StepVector & | preHandlers () const |
Return a reference to the list of default pre-handlers. | |
virtual tStepHdlPtr | defaultHandler () const =0 |
Return a pointer to the default main handler. | |
StepVector & | postHandlers () |
Return a reference to the list of default post-handlers. | |
const StepVector & | postHandlers () const |
Return a reference to the list of default post-handlers. | |
virtual tStepHdlPtr | handler () const =0 |
Return a pointer to the current main handler. | |
virtual void | setHandler ()=0 |
Unset the current main handler. | |
virtual bool | setHandler (tStepHdlPtr, const HandlerGroupBase &ext)=0 |
Set the current main handler, but also refill the current pre- and post- handlers with the defaults from ext. | |
virtual void | refillDefaultHandler (tStepHdlPtr)=0 |
Set the current main handler. | |
void | refillDefaults (const HandlerGroupBase &) |
Fill main, pre- and post- handlers with the default ones. | |
virtual void | clear () |
Clear all current handlers, but don't touch the default ones. | |
virtual string | handlerClass () const =0 |
Return the base class name of the main handler type. | |
void | interfaceSetPrehandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceInsertPrehandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceErasePrehandler (int i) |
Utility function used for the interface. | |
vector< StepHdlPtr > | interfaceGetPrehandlers () const |
Utility function used for the interface. | |
void | interfaceSetPosthandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceInsertPosthandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceErasePosthandler (int i) |
Utility function used for the interface. | |
vector< StepHdlPtr > | interfaceGetPosthandlers () const |
Utility function used for the interface. | |
virtual void | write (PersistentOStream &) const |
Write to persistent streams. | |
virtual void | read (PersistentIStream &) |
Read from persistent streams. | |
Private Member Functions | |
HandlerGroup< HDLR > & | operator= (const HandlerGroup< HDLR > &)=delete |
Assignment is private. | |
Private Attributes | |
HdlPtr | theDefaultHandler |
The default main handler. | |
HdlPtr | theHandler |
The current main handler. | |
Additional Inherited Members | |
Protected Member Functions inherited from ThePEG::HandlerGroupBase | |
HandlerGroupBase (const HandlerGroupBase &) | |
The copy constructor is only used via subclasses. | |
Protected Attributes inherited from ThePEG::HandlerGroupBase | |
bool | isEmpty |
True if the current handlers are empty. | |
StepVector | theDefaultPreHandlers |
The default pre-handlers with hints. | |
StepVector | theDefaultPostHandlers |
The default post-handlers with hints. | |
StepHintVector | thePreHandlers |
The current pre-handlers with hints. | |
HintVector | theHints |
The current hints for the main handler. | |
StepHintVector | thePostHandlers |
The current post-handlers with hints. | |
HandlerGroup is a templated utility class to manage a group of StepHandler
s.
All HandlerGroup classes are derived from the HandlerGroupBase
class. As an example the specialization HandlerGroup<CascadeHandler>
keeps a CascadeHandler object and associated pre- and post- StepHandlers, defining shich steps should be performed before the perturbative cascade, which object should be used for the cascade and which steps should be performed after.
The HandlerGroup
keesp both a default main handler and the corresponding default pre- and post- handlers as well as the main handler and pre/post hadlers chosen for the current event. The current handlers are accompanied by Hints. Handlers which are copied from the default ones are accompanied by the default Hint, while handlers supplied from the outside may be accompanied by any kind of hint. The main handler can be supplied with several hints, the pre- and post- handlers may only have one hint each.
The HandlerGroup
class is used in the EventHandler and SubProcessHandler to manage the post-sub-process handler, the cascade, multiple interaction, hadronization and decay handler groups.
Definition at line 321 of file HandlerGroup.h.
typedef Ptr<HDLR>::pointer ThePEG::HandlerGroup< HDLR >::HdlPtr |
A pointer to the template argument class.
Definition at line 326 of file HandlerGroup.h.
typedef Ptr<HDLR>::transient_pointer ThePEG::HandlerGroup< HDLR >::tHdlPtr |
A transient pointer to the template argument class.
Definition at line 329 of file HandlerGroup.h.
|
virtual |
Clear all current handlers, but don't touch the default ones.
Reimplemented from ThePEG::HandlerGroupBase.
|
inlinevirtual |
Return a pointer to the default main handler.
Implements ThePEG::HandlerGroupBase.
Definition at line 359 of file HandlerGroup.h.
References ThePEG::HandlerGroup< HDLR >::theDefaultHandler.
|
inlinevirtual |
Return a pointer to the current main handler.
Implements ThePEG::HandlerGroupBase.
Definition at line 352 of file HandlerGroup.h.
References ThePEG::HandlerGroup< HDLR >::theHandler.
|
virtual |
Return the base class name of the main handler type.
Implements ThePEG::HandlerGroupBase.
|
inlinevirtual |
Read from persistent streams.
Reimplemented from ThePEG::HandlerGroupBase.
Definition at line 400 of file HandlerGroup.h.
References ThePEG::HandlerGroupBase::read(), ThePEG::HandlerGroup< HDLR >::theDefaultHandler, and ThePEG::HandlerGroup< HDLR >::theHandler.
Referenced by ThePEG::operator>>().
|
virtual |
Set the current main handler.
If the null pointer use the default main handler.
Implements ThePEG::HandlerGroupBase.
|
inlinevirtual |
Unset the current main handler.
Implements ThePEG::HandlerGroupBase.
Definition at line 347 of file HandlerGroup.h.
References ThePEG::HandlerGroup< HDLR >::theHandler.
|
virtual |
Set the current main handler.
Also refill the current pre- and post- handlers with the defaults from ext.
Implements ThePEG::HandlerGroupBase.
|
inlinevirtual |
Write to persistent streams.
Reimplemented from ThePEG::HandlerGroupBase.
Definition at line 392 of file HandlerGroup.h.
References ThePEG::HandlerGroup< HDLR >::theDefaultHandler, ThePEG::HandlerGroup< HDLR >::theHandler, and ThePEG::HandlerGroupBase::write().
Referenced by ThePEG::operator<<().
|
private |
The default main handler.
Definition at line 411 of file HandlerGroup.h.
Referenced by ThePEG::HandlerGroup< HDLR >::defaultHandler(), ThePEG::HandlerGroup< HDLR >::read(), and ThePEG::HandlerGroup< HDLR >::write().
|
private |
The current main handler.
Definition at line 416 of file HandlerGroup.h.
Referenced by ThePEG::HandlerGroup< HDLR >::handler(), ThePEG::HandlerGroup< HDLR >::read(), ThePEG::HandlerGroup< HDLR >::setHandler(), and ThePEG::HandlerGroup< HDLR >::write().