Warning, /include/ThePEG/Interface/Command.tcc is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //
0003 // Command.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 Command class.
0012 //
0013
0014 namespace ThePEG {
0015
0016 template <class T>
0017 string Command<T>::cmd(InterfacedBase & i, string arg) const
0018 {
0019 T * t = dynamic_cast<T *>(&i);
0020 if ( !t ) throw InterExClass(*this, i);
0021 if ( theExeFn ) {
0022 try {
0023 string r = (t->*theExeFn)(arg);
0024 if ( r != "" ) i.touch();
0025 return r;
0026 }
0027 catch (InterfaceException & e) { throw e; }
0028 catch ( ... ) { throw CmdExUnknown(*this, i, arg); }
0029 } else throw InterExSetup(*this, i);
0030 }
0031
0032 }