diff --git a/src/info.cpp b/src/info.cpp index 0e8136278d965d8c0bb30baf835fa8676d85d643..bb8380aa19d2dc8cb3eb8e17c40208e8a642d967 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -737,10 +737,9 @@ void Info::command_styles(FILE * out) fprintf(out, "\nCommand styles (add-on input script commands):\n"); vector<string> styles; -#define COMMAND_CLASS -#define CommandStyle(key,Class) styles.push_back(#key); -#include "style_command.h" -#undef COMMAND_CLASS + for(Input::CommandCreatorMap::iterator it = input->command_map->begin(); it != input->command_map->end(); ++it) { + styles.push_back(it->first); + } print_columns(out, styles); fprintf(out, "\n\n\n"); } diff --git a/src/input.cpp b/src/input.cpp index 4ab4a6b968f81e1c1ea9423dca0abf85976335ec..905e7f0590438ad068f347b4b30cd87d5a2102b0 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -93,7 +93,7 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) // fill map with commands listed in style_command.h - command_map = new std::map<std::string,CommandCreator>(); + command_map = new CommandCreatorMap(); #define COMMAND_CLASS #define CommandStyle(key,Class) \ diff --git a/src/input.h b/src/input.h index c1947fee03ce436821a354841ba4b6ec1caed33c..33a271ccdf534c62c8390c58e4b2752393bb6216 100644 --- a/src/input.h +++ b/src/input.h @@ -53,10 +53,12 @@ class Input : protected Pointers { FILE **infiles; // list of open input files - protected: + public: typedef void (*CommandCreator)(LAMMPS *, int, char **); - std::map<std::string,CommandCreator> *command_map; + typedef std::map<std::string,CommandCreator> CommandCreatorMap; + CommandCreatorMap *command_map; + protected: template <typename T> static void command_creator(LAMMPS *, int, char **); private: