Format classes

Interface for formats

class chemfiles::Format

The `Format` class defines the interface to implement in order to add a new format to chemfiles. It is possible to implement only one of `Format::read`; `Format::read_step` or `Format::write`. In that case, only the corresponding operations will be available from the corresponding `chemfiles::Trajectory`.

Subclassed by chemfiles::final< F >, chemfiles::final< F >, chemfiles::final< F >, chemfiles::final< F >, chemfiles::final< F >

Public Functions

void read_step(size_t step, Frame &frame)

Read a specific step from the trajectory file.

Exceptions
  • FormatError: if the file does not follow the format
  • FileError: if their is an OS error while reading the file
Parameters
  • step: The step to read
  • frame: The frame to fill

void read(Frame &frame)

Read a specific step from the trajectory file.

Exceptions
  • FormatError: if the file does not follow the format
  • FileError: if their is an OS error while reading the file
Parameters
  • frame: The frame to fill

void write(const Frame &frame)

Write a frame to the trajectory file.

Exceptions
  • FormatError: if the file does not follow the format
  • FileError: if their is an OS error while reading the file
Parameters
  • frame: The frame to be writen

virtual size_t nsteps() = 0

Get the number of frames in the associated file.

Return
The number of frames

virtual std::string description() const = 0

Get a short description of the format.

Implemented formats

These classes implement the format interface defined previously.

Warning

doxygenclass: Cannot find class “chemfiles::XYZFormat” in doxygen xml output for project “chemfiles” from directory: /home/travis/build/chemfiles/chemfiles/build/doc/doxygen/xml

Warning

doxygenclass: Cannot find class “chemfiles::PDBFormat” in doxygen xml output for project “chemfiles” from directory: /home/travis/build/chemfiles/chemfiles/build/doc/doxygen/xml

Warning

doxygenclass: Cannot find class “chemfiles::NCFormat” in doxygen xml output for project “chemfiles” from directory: /home/travis/build/chemfiles/chemfiles/build/doc/doxygen/xml

Warning

doxygenclass: Cannot find class “chemfiles::TNGFormat” in doxygen xml output for project “chemfiles” from directory: /home/travis/build/chemfiles/chemfiles/build/doc/doxygen/xml

Warning

doxygenclass: Cannot find class “chemfiles::Molfile” in doxygen xml output for project “chemfiles” from directory: /home/travis/build/chemfiles/chemfiles/build/doc/doxygen/xml

enum chemfiles::MolfileFormat

List all the VMD molfile plugins enabled. For more documentation about VMD molfile plugins, please see: http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/

Values:

DCD

DCD binary file format.

GRO

Gromacs .gro file format.

TRR

Gromacs .trr file format.

XTC

Gromacs .xtc file format.

TRJ

Gromacs .trj file format.

LAMMPS

Lammps trajectory files.