Pteros  2.0
Molecular modeling library for human beings!
vmd_molfile_plugin_wrapper.h
1 /*
2  *
3  * This source code is part of
4  * ******************
5  * *** Pteros ***
6  * ******************
7  * molecular modeling library
8  *
9  * Copyright (c) 2009-2013, Semen Yesylevskyy
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of Artistic License:
13  *
14  * Please note, that Artistic License is slightly more restrictive
15  * then GPL license in terms of distributing the modified versions
16  * of this software (they should be approved first).
17  * Read http://www.opensource.org/licenses/artistic-license-2.0.php
18  * for details. Such license fits scientific software better then
19  * GPL because it prevents the distribution of bugged derivatives.
20  *
21 */
22 
23 #ifndef VMD_MOLFILE_PLUGIN_WRAPPER_H
24 #define VMD_MOLFILE_PLUGIN_WRAPPER_H
25 
26 #include <string>
27 #include "pteros/core/system.h"
28 #include "pteros/core/selection.h"
29 #include "pteros/core/mol_file.h"
30 #include "molfile_plugin.h"
31 
32 namespace pteros {
33 
36 public:
37  // High-level API
38  VMD_molfile_plugin_wrapper(std::string& fname);
39  virtual void open(char open_mode);
40  virtual ~VMD_molfile_plugin_wrapper();
41 
42 protected:
43  void* handle; // Handle for reading
44  void* w_handle; // Handle for writing
45 
46  molfile_plugin_t* plugin;
47  char mode;
48 
49  virtual bool do_read(System *sys, Frame *frame, const Mol_file_content& what);
50  virtual void do_write(const Selection &sel, const Mol_file_content& what);
51 };
52 
53 }
54 #endif /* MOL_FILE_H */
Definition of single trajectory frame.
Definition: system.h:67
Pteros namespace.
Definition: options.cpp:32
The system of atoms.
Definition: system.h:95
virtual void open(char open_mode)
Opens a file with given access mode. Need to be defined by derived classes.
Definition: vmd_molfile_plugin_wrapper.cpp:102
Selection class.
Definition: atom_proxy.h:57
Generic API for reading and writing any molecule file formats.
Definition: vmd_molfile_plugin_wrapper.h:35
Generic API for reading and writing any molecule file formats.
Definition: mol_file.h:43