convert one more factory template

This commit is contained in:
Axel Kohlmeyer
2022-02-11 18:38:36 -05:00
parent 6a0e93a18a
commit df02598fc1
2 changed files with 9 additions and 13 deletions

View File

@ -57,6 +57,15 @@ using namespace LAMMPS_NS;
#define DELTALINE 256 #define DELTALINE 256
#define DELTA 4 #define DELTA 4
/* ----------------------------------------------------------------------
one instance per command in style_command.h
------------------------------------------------------------------------- */
template <typename T> static Command *command_creator(LAMMPS *lmp)
{
return new T(lmp);
}
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/** \class LAMMPS_NS::Input /** \class LAMMPS_NS::Input
@ -810,16 +819,6 @@ int Input::execute_command()
return -1; return -1;
} }
/* ----------------------------------------------------------------------
one instance per command in style_command.h
------------------------------------------------------------------------- */
template <typename T>
Command *Input::command_creator(LAMMPS *lmp)
{
return new T(lmp);
}
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -64,9 +64,6 @@ class Input : protected Pointers {
typedef std::map<std::string, CommandCreator> CommandCreatorMap; typedef std::map<std::string, CommandCreator> CommandCreatorMap;
CommandCreatorMap *command_map; CommandCreatorMap *command_map;
protected:
template <typename T> static Command *command_creator(LAMMPS *);
private: private:
void parse(); // parse an input text line void parse(); // parse an input text line
char *nextword(char *, char **); // find next word in string with quotes char *nextword(char *, char **); // find next word in string with quotes