You may find the following directory in the chemfiles sources :
cmake
: some CMake modules used for build configuration;doc
: this documentation;examples
: usage examples for C and C++ interfaces;external
: external libraries used by chemfiles;include
: the headers of chemfiles;scripts
: some python scripts used for developpement.src
: the sources of the library;tests
: the sources of the unit tests;Chemfiles is written in C++11, in an object-oriented fashion. A Trajectory
is built on the top of two other private classes: a File and a
Format. The File
classes provides IO operation, and the
Format
classes do all the work for reading/writing information from the File
.
All the File to Format associations are managed by the TrajectoryFactory class.
chemfiles::TrajectoryFactory
This class allow to register at compile time various Format and the associated File class, giving at runtime the good format when asked politely.
Each couple (File, Format) is represented by a trajectory_builder_t instance, and can be registered by an extension, or by a Format name.
Public Functions
format
(const string & name)Get a trajectory_builder from a format type name.
Throws an error if the format can not be found
name
- the format name
by_extension
(const string & ext)Get a trajectory_builder from a format extention
.
Throws an error if the format can not be found
ext
- the format extention
register_format
(const string & name, trajectory_builder_t tb)Register a trajectory_builder in the internal format names list.
register_extension
(const string & ext, trajectory_builder_t tb)Register an trajectory_builder in the internal extensions list.
Public Static Functions
get
()Get the instance of the TrajectoryFactory.