convert one more factory template
This commit is contained in:
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user