LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
|
Base class for writing trajectories. More...
#include <trajwriter.hpp>
Public Member Functions | |
TrajectoryWriter (const std::string &fname, const bool append=false) | |
Write a trajectory to a file, optionally appending. | |
TrajectoryWriter (std::iostream *s, const bool append=false) | |
Write a trajectory to a stream. | |
virtual void | setComments (const std::vector< std::string > &comments) |
Set comments in metadata (not all formats support) | |
virtual void | setComments (const std::string &s) |
Set comment in metadata (not all formats support) | |
virtual void | writeFrame (const AtomicGroup &model)=0 |
Wirte a single frame. | |
virtual void | writeFrame (const AtomicGroup &model, const uint step, const double time) |
Write a single frame specifying the step and timepoint. | |
virtual bool | hasFrameStep () const |
Can format write step on a per-frame basis? | |
virtual bool | hasFrameTime () const |
Can format write time on a per-frame basis? | |
virtual bool | hasComments () const |
Does format support comments in metadata? | |
virtual uint | framesWritten () const =0 |
Total frames in output file. | |
bool | isAppending () const |
Returns true if appending to an existing trajectory. | |
Protected Attributes | |
std::iostream * | stream_ |
std::string | _filename |
bool | appending_ |
bool | delete_ |
Base class for writing trajectories.
This is the interface for creating and writing to trajectories. The interface is kept simple on purpose to make it easy to work with multiple formats. This means that trajectory and frame metadata may be set to default values. If you need more control over how the trajectory is written, then use the derived classes explicitly.
|
inline |
Write a trajectory to a stream.
Note that this constructor assumes that the stream is correctly prepped by the caller...if you need to seekp() to the end of the stream for appending, then this must be done before instantiating the TrajectoryWriter object.
|
pure virtual |
Total frames in output file.
For files being appended too, this includes the frames already written...
Implemented in loos::XTCWriter, and loos::DCDWriter.
|
inlinevirtual |
Does format support comments in metadata?
Reimplemented in loos::DCDWriter.
|
inlinevirtual |
Set comments in metadata (not all formats support)
Reimplemented in loos::DCDWriter.
|
pure virtual |
Wirte a single frame.
Implemented in loos::DCDWriter, and loos::XTCWriter.
|
inlinevirtual |
Write a single frame specifying the step and timepoint.
Not all formats support this. By default, it will drop the extra data and call writeFrame()
Reimplemented in loos::XTCWriter.