Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::readers::ArcReader Class Reference

Reads an ARC file and returns a vector of correlation::core::Cell objects. More...

#include <ArcReader.hpp>

Inheritance diagram for correlation::readers::ArcReader:
Collaboration diagram for correlation::readers::ArcReader:

Public Member Functions

std::string getName () const override
 Returns the display name of the format.
std::vector< std::string > getExtensions () const override
 Returns a list of supported file extensions.
bool isTrajectory () const override
 Returns true if this reader supports trajectory files.
correlation::core::Cell readStructure (const std::string &filename, std::function< void(float, const std::string &)> progress_callback=nullptr) override
 Reads an atomic structure from a file.
correlation::core::Trajectory readTrajectory (const std::string &filename, std::function< void(float, const std::string &)> progress_callback=nullptr) override
 Reads a trajectory from a file.
Public Member Functions inherited from correlation::readers::BaseReader
 BaseReader ()=default
 ~BaseReader () override=default
 BaseReader (const BaseReader &)=delete
BaseReader & operator= (const BaseReader &)=delete
 BaseReader (BaseReader &&)=delete
BaseReader & operator= (BaseReader &&)=delete
virtual correlation::core::Trajectory readTrajectory (const std::vector< std::string > &filenames, ProgressCallback progress_callback=nullptr)
 Reads a trajectory concatenated across multiple files.
Public Member Functions inherited from correlation::readers::IStructureReader
 IStructureReader ()=default
virtual ~IStructureReader ()=default
 IStructureReader (const IStructureReader &)=delete
IStructureReader & operator= (const IStructureReader &)=delete
 IStructureReader (IStructureReader &&)=delete
IStructureReader & operator= (IStructureReader &&)=delete
Public Member Functions inherited from correlation::readers::ITrajectoryReader
 ITrajectoryReader ()=default
virtual ~ITrajectoryReader ()=default
 ITrajectoryReader (const ITrajectoryReader &)=delete
ITrajectoryReader & operator= (const ITrajectoryReader &)=delete
 ITrajectoryReader (ITrajectoryReader &&)=delete
ITrajectoryReader & operator= (ITrajectoryReader &&)=delete

Static Public Member Functions

static std::vector< correlation::core::Cell > read (const std::string &file_name, const std::function< void(float, const std::string &)> &progress_callback=nullptr)
 Low-level parser for the specific file format.

Static Private Member Functions

static void updateProgress (std::streampos current_pos, std::streampos file_size, std::streampos &last_progress_pos, std::streamoff update_interval, const std::function< void(float, const std::string &)> &progress_callback)
static void parseLine (const std::string &line, correlation::core::Cell &temp_cell, std::vector< correlation::core::Cell > &frames)

Detailed Description

Reads an ARC file and returns a vector of correlation::core::Cell objects.

Member Function Documentation

◆ getExtensions()

std::vector< std::string > correlation::readers::ArcReader::getExtensions ( ) const
inlineoverridevirtual

Returns a list of supported file extensions.

Returns
A vector of strings containing extensions (e.g. {".cif", ".ext"}).

Implements correlation::readers::BaseReader.

◆ getName()

std::string correlation::readers::ArcReader::getName ( ) const
inlineoverridevirtual

Returns the display name of the format.

Returns
A string representing the format name (e.g. "LAMMPS Dump", "CIF").

Implements correlation::readers::BaseReader.

◆ isTrajectory()

bool correlation::readers::ArcReader::isTrajectory ( ) const
inlineoverridevirtual

Returns true if this reader supports trajectory files.

Returns
True if the format can store multiple time steps.

Implements correlation::readers::BaseReader.

◆ parseLine()

void correlation::readers::ArcReader::parseLine ( const std::string & line,
correlation::core::Cell & temp_cell,
std::vector< correlation::core::Cell > & frames )
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

std::vector< correlation::core::Cell > correlation::readers::ArcReader::read ( const std::string & file_name,
const std::function< void(float, const std::string &)> & progress_callback = nullptr )
static

Low-level parser for the specific file format.

Parameters
file_namePath to the source file.
progress_callbackOptional callback for progress updates.
Returns
A vector of parsed frames.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readStructure()

correlation::core::Cell correlation::readers::ArcReader::readStructure ( const std::string & filename,
std::function< void(float, const std::string &)> progress_callback = nullptr )
overridevirtual

Reads an atomic structure from a file.

Parameters
[in]filenamePath to the file to be read.
[in]progress_callbackOptional callback to report progress [0.0, 1.0].
Returns
A Cell object containing the loaded structure.

Implements correlation::readers::BaseReader.

◆ readTrajectory()

correlation::core::Trajectory correlation::readers::ArcReader::readTrajectory ( const std::string & filename,
std::function< void(float, const std::string &)> progress_callback = nullptr )
overridevirtual

Reads a trajectory from a file.

Parameters
[in]filenamePath to the file to be read.
[in]progress_callbackOptional callback to report progress [0.0, 1.0].
Returns
A Trajectory object containing all loaded frames.

Implements correlation::readers::BaseReader.

Here is the call graph for this function:

◆ updateProgress()

void correlation::readers::ArcReader::updateProgress ( std::streampos current_pos,
std::streampos file_size,
std::streampos & last_progress_pos,
std::streamoff update_interval,
const std::function< void(float, const std::string &)> & progress_callback )
staticprivate
Here is the caller graph for this function:

The documentation for this class was generated from the following files: