#include <colvarscript.h>
Public Types | |||||
enum | command { COMM, HELP, N_ARGS_MIN, N_ARGS_MAX, ARGS, cv_addenergy, VMD, add } | ||||
Commands available. More... | |||||
enum | Object_type { use_module, use_colvar, use_bias } | ||||
Type of object handling a script command. More... | |||||
Public Methods | |||||
colvarscript (colvarproxy *p, colvarmodule *m) | |||||
~colvarscript () | |||||
int | run (int objc, unsigned char *const objv[]) | ||||
Run a script command with space-separated positional arguments (objects). More... | |||||
std::string const & | str_result () const | ||||
Get the string result of the current scripting call. More... | |||||
std::string & | modify_str_result () | ||||
Modify the string result of the current scripting call. More... | |||||
int | set_result_str (std::string const &s) | ||||
Set the return value to the given string. More... | |||||
int | clear_str_result () | ||||
Clear the string result. More... | |||||
void | add_error_msg (std::string const &s) | ||||
Add the given string to the error message of the script interface. More... | |||||
std::string | get_cmd_prefix (Object_type t) | ||||
Return the prefix of the individual command for each object function. More... | |||||
template<Object_type T> unsigned char * | get_cmd_arg (int iarg, int objc, unsigned char *const objv[]) | ||||
Get a pointer to the i-th argument of the command (NULL if not given). More... | |||||
unsigned char * | get_module_cmd_arg (int iarg, int objc, unsigned char *const objv[]) | ||||
Instantiation of get_cmd_arg<> for module-level commands. More... | |||||
unsigned char * | get_colvar_cmd_arg (int iarg, int objc, unsigned char *const objv[]) | ||||
Instantiation of get_cmd_arg<> for colvar-level commands. More... | |||||
unsigned char * | get_bias_cmd_arg (int iarg, int objc, unsigned char *const objv[]) | ||||
Instantiation of get_cmd_arg<> for bias-level commands. More... | |||||
template<Object_type T> int | check_cmd_nargs (char const *cmd, int objc, int n_args_min, int n_args_max) | ||||
Check the argument count of the command. More... | |||||
int | check_module_cmd_nargs (char const *cmd, int objc, int n_args_min, int n_args_max) | ||||
Instantiation of check_cmd_nargs<> for module-level commands. More... | |||||
int | check_colvar_cmd_nargs (char const *cmd, int objc, int n_args_min, int n_args_max) | ||||
Instantiation of check_cmd_nargs<> for colvar-level commands. More... | |||||
int | check_bias_cmd_nargs (char const *cmd, int objc, int n_args_min, int n_args_max) | ||||
Instantiation of get_cmd_arg<> for bias-level commands. More... | |||||
template<colvarscript::Object_type T> int | cmd_arg_shift () | ||||
Number of positional arguments to shift for each object type. More... | |||||
char const ** | get_command_names () const | ||||
Get names of all commands. More... | |||||
char const * | get_command_help (char const *cmd) | ||||
Get one-line help summary for a command
| |||||
char const * | get_command_rethelp (char const *cmd) | ||||
Get description of the return value of a command
| |||||
char const * | get_command_arghelp (char const *cmd, int i) | ||||
Get description of the argument of a command (excluding prefix)
| |||||
int | get_command_n_args_min (char const *cmd) | ||||
Get number of required arguments (excluding prefix)
| |||||
int | get_command_n_args_max (char const *cmd) | ||||
Get number of total arguments (excluding prefix)
| |||||
char const * | get_command_full_help (char const *cmd) | ||||
Get help string for a command (does not specify how it is launched)
| |||||
std::string | get_cmdline_help_summary (Object_type t) | ||||
Get summary of command line syntax for all commands of a given context
| |||||
std::string | get_command_cmdline_syntax (Object_type t, command c) | ||||
Get a description of how the command should be used in a command line
| |||||
std::string | get_command_cmdline_help (Object_type t, std::string const &cmd) | ||||
Get the command line syntax following by the help string
| |||||
int | unsupported_op () | ||||
Set error code for unsupported script operation. More... | |||||
colvarmodule * | module () | ||||
Pointer to the Colvars main object. More... | |||||
colvarproxy * | proxy () | ||||
Pointer to the colvarproxy object (interface with host engine). More... | |||||
char * | obj_to_str (unsigned char *obj) | ||||
Get the string representation of an object (by default, a simple cast). More... | |||||
std::vector< std::string > | obj_to_str_vector (unsigned char *obj) | ||||
Get a list of strings from an object (does not work with a simple cast). More... | |||||
int | set_result_int (int const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_int_vec (std::vector< int > const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_long_int (long int const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_long_int_vec (std::vector< long int > const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_real (cvm::real const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_real_vec (std::vector< cvm::real > const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_rvector (cvm::rvector const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_rvector_vec (std::vector< cvm::rvector > const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_colvarvalue (colvarvalue const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | set_result_colvarvalue_vec (std::vector< colvarvalue > const &x, unsigned char *obj=NULL) | ||||
Copy x into obj if not NULL, or into the script object's result otherwise. More... | |||||
int | proc_features (colvardeps *obj, int argc, unsigned char *const argv[]) | ||||
Run subcommands on base colvardeps object (colvar, bias, ...). More... | |||||
template<> int | set_result_text (int const &x, unsigned char *obj) | ||||
template<> int | set_result_text (std::vector< int > const &x, unsigned char *obj) | ||||
template<> int | set_result_text (long int const &x, unsigned char *obj) | ||||
template<> int | set_result_text (std::vector< long int > const &x, unsigned char *obj) | ||||
template<> int | set_result_text (cvm::real const &x, unsigned char *obj) | ||||
template<> int | set_result_text (std::vector< cvm::real > const &x, unsigned char *obj) | ||||
template<> int | set_result_text (std::vector< cvm::rvector > const &x, unsigned char *obj) | ||||
template<> int | set_result_text (std::vector< colvarvalue > const &x, unsigned char *obj) | ||||
Public Attributes | |||||
std::string | str_result_ | ||||
String representation of the result of a script call. More... | |||||
Friends | |||||
class | colvarproxy |
|
Commands available.
Definition at line 73 of file colvarscript.h. |
|
Type of object handling a script command.
Definition at line 1186 of file colvarscript.h. |
|
Definition at line 34 of file colvarscript.C. References colvarmodule::error, colvarproxy_tcl::get_tcl_interp, colvarproxy_tcl::init_tcl_pointers, colvarmodule::log, NULL, proxy, and tcl_run_colvarscript_command. |
|
Definition at line 57 of file colvarscript.C. References NULL. |
|
Add the given string to the error message of the script interface.
Definition at line 1689 of file colvarscript.C. |
|
Instantiation of get_cmd_arg<> for bias-level commands.
Definition at line 1507 of file colvarscript.h. |
|
Check the argument count of the command.
Definition at line 1467 of file colvarscript.h. |
|
Instantiation of check_cmd_nargs<> for colvar-level commands.
Definition at line 1498 of file colvarscript.h. |
|
Instantiation of check_cmd_nargs<> for module-level commands.
Definition at line 1489 of file colvarscript.h. |
|
Clear the string result.
Definition at line 1699 of file colvarscript.C. |
|
Number of positional arguments to shift for each object type.
Definition at line 1517 of file colvarscript.h. |
|
Instantiation of get_cmd_arg<> for bias-level commands.
Definition at line 1459 of file colvarscript.h. |
|
Get a pointer to the i-th argument of the command (NULL if not given).
Definition at line 1436 of file colvarscript.h. |
|
Return the prefix of the individual command for each object function.
Definition at line 1268 of file colvarscript.C. |
|
Get summary of command line syntax for all commands of a given context
Definition at line 1395 of file colvarscript.C. |
|
Instantiation of get_cmd_arg<> for colvar-level commands.
Definition at line 1452 of file colvarscript.h. |
|
Get description of the argument of a command (excluding prefix)
Definition at line 1309 of file colvarscript.C. Referenced by cvscript_command_arghelp. |
|
Get the command line syntax following by the help string
Definition at line 1427 of file colvarscript.C. |
|
Get a description of how the command should be used in a command line
Definition at line 1357 of file colvarscript.C. |
|
Get help string for a command (does not specify how it is launched)
Definition at line 1345 of file colvarscript.C. Referenced by cvscript_command_full_help. |
|
Get one-line help summary for a command
Definition at line 1285 of file colvarscript.C. Referenced by cvscript_command_help. |
|
Get number of total arguments (excluding prefix)
Definition at line 1333 of file colvarscript.C. Referenced by cvscript_command_n_args_max. |
|
Get number of required arguments (excluding prefix)
Definition at line 1321 of file colvarscript.C. Referenced by cvscript_command_n_args_min. |
|
Get names of all commands.
Definition at line 1233 of file colvarscript.h. Referenced by cvscript_command_names. |
|
Get description of the return value of a command
Definition at line 1297 of file colvarscript.C. Referenced by cvscript_command_rethelp. |
|
Instantiation of get_cmd_arg<> for module-level commands.
Definition at line 1445 of file colvarscript.h. |
|
Modify the string result of the current scripting call.
Definition at line 58 of file colvarscript.h. References str_result_. |
|
Pointer to the Colvars main object.
Definition at line 1283 of file colvarscript.h. |
|
Get the string representation of an object (by default, a simple cast).
Definition at line 1545 of file colvarscript.C. |
|
Get a list of strings from an object (does not work with a simple cast).
Definition at line 1556 of file colvarscript.C. |
|
Run subcommands on base colvardeps object (colvar, bias, ...).
Definition at line 1599 of file colvarscript.C. |
|
Pointer to the colvarproxy object (interface with host engine).
Definition at line 1289 of file colvarscript.h. Referenced by colvarscript. |
|
Run a script command with space-separated positional arguments (objects).
Definition at line 1441 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 2006 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 2011 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1966 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1970 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1976 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1980 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1986 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1990 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 1996 of file colvarscript.C. |
|
Copy x into obj if not NULL, or into the script object's result otherwise.
Definition at line 2000 of file colvarscript.C. |
|
Set the return value to the given string.
Definition at line 1677 of file colvarscript.C. |
|
Definition at line 1953 of file colvarscript.C. |
|
Definition at line 1942 of file colvarscript.C. |
|
Definition at line 1930 of file colvarscript.C. |
|
Definition at line 1924 of file colvarscript.C. |
|
Definition at line 1915 of file colvarscript.C. |
|
Definition at line 1909 of file colvarscript.C. |
|
Definition at line 1900 of file colvarscript.C. |
|
Definition at line 1894 of file colvarscript.C. |
|
Get the string result of the current scripting call.
Definition at line 52 of file colvarscript.h. References str_result_. |
|
Set error code for unsupported script operation.
Definition at line 1670 of file colvarscript.C. |
|
Definition at line 39 of file colvarscript.h. |
|
String representation of the result of a script call.
Definition at line 46 of file colvarscript.h. Referenced by modify_str_result, and str_result. |