Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
q3::InputFormat Class Referenceabstract

One input format a run can be read from; see the file comment. More...

#include <input_format.hpp>

+ Inheritance diagram for q3::InputFormat:

Public Member Functions

virtual ~InputFormat ()=default
 
virtual bool claims_working_directory (const std::filesystem::path &) const
 
virtual std::unique_ptr< InputParser > create_parser () const =0
 A parser for inputs of this format.
 
virtual int detection_priority () const =0
 
virtual std::string display_name () const =0
 How a log line names an input of this format, e.g. "a Quantum ESPRESSO input".
 
virtual std::vector< std::string > names () const =0
 
virtual bool recognizes (const std::filesystem::path &path) const =0
 Whether path names an input of this format, judged without parsing it.
 
virtual void write_companion_outputs (const InputData &, const generated::Results &) const
 

Detailed Description

One input format a run can be read from; see the file comment.

Definition at line 36 of file input_format.hpp.

Constructor & Destructor Documentation

◆ ~InputFormat()

virtual q3::InputFormat::~InputFormat ( )
virtualdefault

Member Function Documentation

◆ claims_working_directory()

virtual bool q3::InputFormat::claims_working_directory ( const std::filesystem::path &  ) const
inlinevirtual

Whether directory holds an input of this format that a run given no input path should read. False for a format whose inputs are always named explicitly.

Definition at line 66 of file input_format.hpp.

◆ create_parser()

virtual std::unique_ptr< InputParser > q3::InputFormat::create_parser ( ) const
pure virtual

A parser for inputs of this format.

Implemented in q3::QEInputFormat, and q3::YAMLInputFormat.

Referenced by q3::create_input_parser(), and q3::parse_input().

◆ detection_priority()

virtual int q3::InputFormat::detection_priority ( ) const
pure virtual

Rank among the formats that recognise a path, highest first. A format that recognises paths by file name or directory contents ranks above one that goes by extension, and the fallback ranks lowest, so a path is claimed by the most specific rule that matches it.

Implemented in q3::QEInputFormat, and q3::YAMLInputFormat.

Referenced by q3::detect_input_format().

◆ display_name()

virtual std::string q3::InputFormat::display_name ( ) const
pure virtual

How a log line names an input of this format, e.g. "a Quantum ESPRESSO input".

Implemented in q3::QEInputFormat, and q3::YAMLInputFormat.

Referenced by q3::cli::read_input().

◆ names()

virtual std::vector< std::string > q3::InputFormat::names ( ) const
pure virtual

The names --format accepts. The first is canonical: parse_input() records it as InputData::source_format, and usage text prints it.

Implemented in q3::QEInputFormat, and q3::YAMLInputFormat.

Referenced by q3::parse_input().

◆ recognizes()

virtual bool q3::InputFormat::recognizes ( const std::filesystem::path &  path) const
pure virtual

Whether path names an input of this format, judged without parsing it.

Implemented in q3::QEInputFormat, and q3::YAMLInputFormat.

◆ write_companion_outputs()

virtual void q3::InputFormat::write_companion_outputs ( const InputData &  ,
const generated::Results &   
) const
inlinevirtual

Write the files this format's conventions expect beside the results of a finished run that was read from it. Writes nothing for a format with no such convention.

Definition at line 78 of file input_format.hpp.


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