#ifndef LMP_MOLFILE_INTERFACE_H
#define LMP_MOLFILE_INTERFACE_H
namespace LAMMPS_NS {
class MolfileInterface
{
public:
enum {M_NONE=0,
M_READ = 1<<0, M_WRITE = 1<<1,
M_RSTRUCT = 1<<2, M_WSTRUCT = 1<<3,
M_RBONDS = 1<<4, M_WBONDS = 1<<5,
M_RANGLES = 1<<6, M_WANGLES = 1<<7,
M_RVOL = 1<<8, M_WVOL = 1<<9,
M_RVELS = 1<<10, M_WVELS = 1<<11,
M_LAST = 1<<12 };
enum {E_NONE=0, E_DIR, E_FILE, E_SYMBOL, E_TYPE, E_ABI, E_MODE, E_VERSION, E_MATCH, E_LAST };
enum {P_NONE=0, P_NAME=1<<0, P_TYPE=1<<1, P_RESN=1<<2, P_RESI=1<<3, P_SEGN=1<<4, P_CHAI=1<<5, P_OCCP=1<<6, P_BFAC=1<<7, P_MASS=1<<8, P_CHRG=1<<9, P_RADS=1<<10, P_ATMN=1<<11, P_LAST=1<<12 };
MolfileInterface(const char *type, const int mode);
~MolfileInterface();
private:
MolfileInterface() {};
MolfileInterface(const MolfileInterface &) {};
MolfileInterface &operator =(const MolfileInterface &) {return *this;};
public:
int find_plugin(const char *path);
int load_plugin(const char *name);
void forget_plugin();
char *get_plugin_name() const { return _name; };
char *get_plugin_type() const { return _type; };
int open(const char *name, int *natoms);
int structure();
int timestep(float *coords, float *vels, float *cell, double *simtime);
int close();
bool is_open() const { return (_ptr != 0); };
bool has_props() const { return (_mode & (M_RSTRUCT|M_WSTRUCT)) != 0; };
bool has_vels() const { return (_mode & (M_RVELS|M_WVELS)) != 0; };
bool get_natoms() const { return _natoms; };
bool get_props() const { return _props; };
int property(int propid, int idx, float *prop);
int property(int propid, int *types, float *prop);
int property(int propid, float *prop);
int property(int propid, int idx, double *prop);
int property(int propid, int *types, double *prop);
int property(int propid, double *prop);
int property(int propid, int idx, int *prop);
int property(int propid, int *types, int *prop);
int property(int propid, int *prop);
int property(int propid, int idx, char *prop);
int property(int propid, int *types, char **prop);
int property(int propid, char **prop);
protected:
void *_plugin; void *_dso; void *_ptr; void *_info; char *_type; char *_name; int _natoms; int _mode; int _caps; int _props; };
}
#endif