Warning, /include/ThePEG/Handlers/HandlerGroup.tcc is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //
0003 // HandlerGroup.tcc is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 //
0010 // This is the implementation of the non-inlined templated member
0011 // functions of the HandlerGroup class.
0012 //
0013
0014 #include "ThePEG/Utilities/ClassTraits.h"
0015 #include "ThePEG/Handlers/Hint.h"
0016
0017 namespace ThePEG {
0018
0019 template <typename HDLR>
0020 HandlerGroup<HDLR>::~HandlerGroup() {}
0021
0022 template <typename HDLR>
0023 bool HandlerGroup<HDLR>::setHandler(tStepHdlPtr hin,
0024 const HandlerGroupBase & ext) {
0025 tHdlPtr h = dynamic_ptr_cast<HdlPtr>(hin);
0026 if ( !h ) return false;
0027 if ( !theHandler ) refillDefaults(ext);
0028 theHandler = h;
0029 isEmpty = false;
0030 return true;
0031 }
0032
0033 template <typename HDLR>
0034 void HandlerGroup<HDLR>::refillDefaultHandler(tStepHdlPtr h) {
0035 tHdlPtr ext = dynamic_ptr_cast<HdlPtr>(h);
0036 if ( ext ) theHandler = ext;
0037 else theHandler = theDefaultHandler;
0038 if ( theHandler ) {
0039 for ( int i = 0, N = theHints.size(); i < N; ++i )
0040 if ( theHints[i] == Hint::Default() ) return;
0041 theHints.push_front(Hint::Default());
0042 isEmpty = false;
0043 }
0044 }
0045
0046 template <typename HDLR>
0047 void HandlerGroup<HDLR>::clear() {
0048 theHandler = HdlPtr();
0049 HandlerGroupBase::clear();
0050 }
0051
0052 template <typename HDLR>
0053 string HandlerGroup<HDLR>::handlerClass() const {
0054 return ClassTraits<HDLR>::className();
0055 }
0056
0057 template <typename HDLR>
0058 void HandlerGroup<HDLR>::interfaceSetHandler(HdlPtr p) {
0059 theDefaultHandler = p;
0060 }
0061
0062 template <typename HDLR>
0063 typename HandlerGroup<HDLR>::HdlPtr
0064 HandlerGroup<HDLR>::interfaceGetHandler() const {
0065 return theDefaultHandler;
0066 }
0067
0068 }