BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Private Member Functions
BALL::TrajectoryFile Class Reference

#include <BALL/FORMAT/trajectoryFile.h>

Inheritance diagram for BALL::TrajectoryFile:
BALL::File BALL::DCDFile BALL::TRRFile

List of all members.

Public Member Functions

Constructors and Destructor
 TrajectoryFile ()
 Default constructor.
 TrajectoryFile (const String &filename, File::OpenMode open_mode=std::ios::in)
virtual ~TrajectoryFile ()
 Destructor.
Assignment
virtual void clear ()
 Clear method.
Predicates
bool operator== (const TrajectoryFile &file) const
 Equality operator.
Accessors
Size getNumberOfSnapShots () const
Size getNumberOfAtoms () const
Public methods for file handling
virtual bool readHeader ()
virtual bool writeHeader ()
virtual bool append (const SnapShot &snapshot)
virtual bool read (SnapShot &snapshot)
virtual bool flushToDisk (const std::vector< SnapShot > &buffer)

Protected Attributes

Size number_of_snapshots_
Size number_of_atoms_

Private Member Functions

const TrajectoryFileoperator= (const TrajectoryFile &file)

Detailed Description

Trajectory file format for MD simulation. This is more an interface definition than an actual class, because it would not make too much sense to create yet-another-trajectory-format. This class will be specialized by actual formats, like DCD.

Definition at line 28 of file trajectoryFile.h.


Constructor & Destructor Documentation

Default constructor.

BALL::TrajectoryFile::TrajectoryFile ( const String filename,
File::OpenMode  open_mode = std::ios::in 
)

Detailed constructor requiring a filename and the mode in which this file should be opened.

Parameters:
filenamethe name of the file
open_modethe mode in which this file should be opened
Exceptions:
Exception::FileNotFoundif the file could not be openend
See also:
File

Destructor.


Member Function Documentation

virtual bool BALL::TrajectoryFile::append ( const SnapShot snapshot) [virtual]

Append a SnapShot to an existing file. Note that this method does note update the header.

Parameters:
snapshotthe SnapShot we want to save
Returns:
true, if writing was successful

Reimplemented in BALL::TRRFile, and BALL::DCDFile.

virtual void BALL::TrajectoryFile::clear ( ) [virtual]

Clear method.

Reimplemented from BALL::File.

Reimplemented in BALL::TRRFile, and BALL::DCDFile.

virtual bool BALL::TrajectoryFile::flushToDisk ( const std::vector< SnapShot > &  buffer) [virtual]

Write several SnapShots to disk.

Parameters:
buffera vector of snapshots
Returns:
true, if flushing was successful, false ow.
Exceptions:
File::CannotWriteif writing to the file failed

Reimplemented in BALL::TRRFile, and BALL::DCDFile.

get the number of atoms coverd by each snapshot.

Returns:
the number of atoms

get the number of snapshots stored in this instance.

Returns:
the number of snapshots of this instance
const TrajectoryFile& BALL::TrajectoryFile::operator= ( const TrajectoryFile file) [private]
bool BALL::TrajectoryFile::operator== ( const TrajectoryFile file) const

Equality operator.

virtual bool BALL::TrajectoryFile::read ( SnapShot snapshot) [virtual]

Read the next SnapShot from the file.

Parameters:
snapshota buffer for result delivery
Returns:
true if a snapshot could be read, false ow.

Reimplemented in BALL::TRRFile, and BALL::DCDFile.

virtual bool BALL::TrajectoryFile::readHeader ( ) [virtual]

Read the header of an existing file.

Returns:
true if the header could be read successfully, false ow.

Reimplemented in BALL::DCDFile.

virtual bool BALL::TrajectoryFile::writeHeader ( ) [virtual]

Write a header.

Returns:
true if the header could be written successfully, false ow.

Reimplemented in BALL::DCDFile.


Member Data Documentation

Definition at line 128 of file trajectoryFile.h.

Definition at line 125 of file trajectoryFile.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines