|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Manages loading of structure/trajectory files and provides atomic/cell metadata. More...
#include <TrajectoryLoader.hpp>

Public Types | |
| using | ProgressCallback = std::function<void(float, const std::string &)> |
Public Member Functions | |
| TrajectoryLoader () | |
| Constructs a TrajectoryLoader using the global default ReaderFactory singleton. | |
| TrajectoryLoader (const correlation::readers::IReaderRegistry ®istry) | |
| Constructs a TrajectoryLoader with an injected IReaderRegistry dependency. | |
| ~TrajectoryLoader ()=default | |
| TrajectoryLoader (const TrajectoryLoader &)=delete | |
| TrajectoryLoader & | operator= (const TrajectoryLoader &)=delete |
| TrajectoryLoader (TrajectoryLoader &&) noexcept=default | |
| TrajectoryLoader & | operator= (TrajectoryLoader &&) noexcept=default |
| std::expected< std::string, std::string > | loadFile (const std::string &path, const ProgressCallback &progress=nullptr) |
| Loads a structure or trajectory file from the given path. | |
| std::expected< std::string, std::string > | loadFiles (const std::vector< std::string > &paths, const ProgressCallback &progress=nullptr) |
| Loads a multi-file trajectory from a collection of paths. | |
| const correlation::core::Trajectory * | trajectory () const noexcept |
| Gets a pointer to the loaded trajectory. | |
| correlation::core::Trajectory * | trajectoryMut () noexcept |
| Gets a mutable pointer to the loaded trajectory. | |
| std::shared_ptr< const correlation::core::Trajectory > | trajectoryShared () const noexcept |
| Gets a shared pointer to the loaded trajectory. | |
| const correlation::core::Cell * | cell () const noexcept |
| Gets a pointer to the first cell frame. | |
| std::map< std::string, int > | getAtomCounts () const |
| Computes atomic species counts for the active cell. | |
| std::vector< std::pair< std::string, int > > | getOrderedAtomCounts () const |
| Computes atomic species counts in cell element-registration order. | |
| bool | renameElement (std::string_view old_symbol, std::string_view new_symbol) |
| Renames an element species across the loaded trajectory. | |
| size_t | getFrameCount () const noexcept |
| Total number of frames in the loaded trajectory. | |
| size_t | getTotalAtomCount () const noexcept |
| Total number of atoms in the primary frame. | |
| size_t | getRemovedFrameCount () const noexcept |
| Number of skipped/removed frames during parsing. | |
| real_t | getTimeStep () const noexcept |
| Simulation timestep of the trajectory in femtoseconds. | |
| real_t | getRecommendedTimeStep () const |
| Recommended timestep derived from atomic masses in the active cell. | |
| void | setTrajectory (std::shared_ptr< correlation::core::Trajectory > traj) noexcept |
| Injects an existing trajectory instance. | |
| void | clear () noexcept |
| Clears currently loaded trajectory and resets state. | |
Private Attributes | |
| std::shared_ptr< correlation::core::Trajectory > | trajectory_ |
| const correlation::readers::IReaderRegistry * | registry_ {nullptr} |
Manages loading of structure/trajectory files and provides atomic/cell metadata.
| using correlation::app::TrajectoryLoader::ProgressCallback = std::function<void(float, const std::string &)> |
| correlation::app::TrajectoryLoader::TrajectoryLoader | ( | ) |
Constructs a TrajectoryLoader using the global default ReaderFactory singleton.


|
explicit |
Constructs a TrajectoryLoader with an injected IReaderRegistry dependency.
| [in] | registry | Injected reader registry for format querying. |
|
default |
|
delete |

|
defaultnoexcept |

|
inlinenodiscardnoexcept |
Gets a pointer to the first cell frame.

|
inlinenoexcept |
Clears currently loaded trajectory and resets state.
|
nodiscard |
Computes atomic species counts for the active cell.

|
inlinenodiscardnoexcept |
Total number of frames in the loaded trajectory.

|
nodiscard |
Computes atomic species counts in cell element-registration order.


|
nodiscard |
Recommended timestep derived from atomic masses in the active cell.


|
inlinenodiscardnoexcept |
Number of skipped/removed frames during parsing.
|
inlinenodiscardnoexcept |
Simulation timestep of the trajectory in femtoseconds.
|
inlinenodiscardnoexcept |
Total number of atoms in the primary frame.

| std::expected< std::string, std::string > correlation::app::TrajectoryLoader::loadFile | ( | const std::string & | path, |
| const ProgressCallback & | progress = nullptr ) |
Loads a structure or trajectory file from the given path.
| [in] | path | Absolute or relative file path. |
| [in] | progress | Optional progress reporting callback. |


| std::expected< std::string, std::string > correlation::app::TrajectoryLoader::loadFiles | ( | const std::vector< std::string > & | paths, |
| const ProgressCallback & | progress = nullptr ) |
Loads a multi-file trajectory from a collection of paths.
| [in] | paths | Collection of file paths making up the trajectory. |
| [in] | progress | Optional progress reporting callback. |


|
delete |

|
defaultnoexcept |

| bool correlation::app::TrajectoryLoader::renameElement | ( | std::string_view | old_symbol, |
| std::string_view | new_symbol ) |
Renames an element species across the loaded trajectory.
| [in] | old_symbol | Existing element symbol (e.g., "1"). |
| [in] | new_symbol | Replacement element symbol (e.g., "Cu"). |
|
inlinenoexcept |
Injects an existing trajectory instance.
| [in] | traj | Trajectory instance to own. |
|
inlinenodiscardnoexcept |
Gets a pointer to the loaded trajectory.


|
inlinenodiscardnoexcept |
Gets a mutable pointer to the loaded trajectory.

|
inlinenodiscardnoexcept |
Gets a shared pointer to the loaded trajectory.
|
private |
|
private |