1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
// -*- c++ -*-
// This file is part of the Collective Variables module (Colvars).
// The original version of Colvars and its updates are located at:
// https://github.com/Colvars/colvars
// Please update all Colvars source files before making any changes.
// If you wish to distribute your changes, please submit them to the
// Colvars repository at GitHub.
#ifndef COLVARPROXY_TCL_H
#define COLVARPROXY_TCL_H
#include <vector>
/// Methods for using Tcl within Colvars
class colvarproxy_tcl {
public:
/// Constructor
colvarproxy_tcl();
/// Destructor
virtual ~colvarproxy_tcl();
/// Is Tcl available? (trigger initialization if needed)
int tcl_available();
/// Get a string representation of the Tcl object pointed to by obj
char const *tcl_get_str(void *obj);
/// Tcl implementation of run_force_callback()
int tcl_run_force_callback();
/// Tcl implementation of run_colvar_callback()
int tcl_run_colvar_callback(
std::string const &name,
std::vector<const colvarvalue *> const &cvcs,
colvarvalue &value);
/// Tcl implementation of run_colvar_gradient_callback()
int tcl_run_colvar_gradient_callback(
std::string const &name,
std::vector<const colvarvalue *> const &cvcs,
std::vector<cvm::matrix2d<cvm::real> > &gradient);
/// Get a pointer to the Tcl interpreter
inline void *get_tcl_interp()
{
return tcl_interp_;
}
/// Set the pointer to the Tcl interpreter
inline void set_tcl_interp(void *interp)
{
tcl_interp_ = interp;
}
protected:
/// Pointer to Tcl interpreter object
void *tcl_interp_;
/// Set Tcl pointers
virtual void init_tcl_pointers();
};
#endif
|