Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 : Copyright (c) 2018-2023 The plumed team 3 : (see the PEOPLE file at the root of the distribution for a list of names) 4 : 5 : See http://www.plumed.org for more information. 6 : 7 : This file is part of plumed, version 2. 8 : 9 : plumed is free software: you can redistribute it and/or modify 10 : it under the terms of the GNU Lesser General Public License as published by 11 : the Free Software Foundation, either version 3 of the License, or 12 : (at your option) any later version. 13 : 14 : plumed is distributed in the hope that it will be useful, 15 : but WITHOUT ANY WARRANTY; without even the implied warranty of 16 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 : GNU Lesser General Public License for more details. 18 : 19 : You should have received a copy of the GNU Lesser General Public License 20 : along with plumed. If not, see <http://www.gnu.org/licenses/>. 21 : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ 22 : #ifndef __PLUMED_core_ActionShortcut_h 23 : #define __PLUMED_core_ActionShortcut_h 24 : 25 : #include "Action.h" 26 : 27 : namespace PLMD { 28 : 29 : /** 30 : \ingroup MULTIINHERIT 31 : Action used to create a command that expands to multiple PLMD::Action commands when read in during input 32 : */ 33 : class ActionShortcut : 34 : public virtual Action { 35 : private: 36 : std::string shortcutlabel; 37 : std::vector<std::string> savedInputLines; 38 : protected: 39 : const std::string & getShortcutLabel() const ; 40 : public: 41 : static void registerKeywords( Keywords& keys ); 42 : /// Constructor 43 : explicit ActionShortcut(const ActionOptions&ao); 44 : /// Read a line of input and create appropriate actions 45 : void readInputLine( const std::string& input ); 46 : /// Do nothing. 47 0 : void calculate() override {} 48 : /// Do nothing. 49 0 : void apply() override {} 50 : /// Get the lines of the shortcut that were read in 51 : std::vector<std::string> getSavedInputLines() const ; 52 : }; 53 : 54 : } 55 : 56 : #endif