SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
benchmax::Tool Class Reference

Base class for any tool. More...

#include <Tool.h>

Inheritance diagram for benchmax::Tool:
Collaboration diagram for benchmax::Tool:

Public Member Functions

 Tool ()=delete
 
 Tool (const Tool &)=delete
 
 Tool (Tool &&)=delete
 
 Tool (const fs::path &binary, const std::string &arguments)
 Creates a generic tool from a binary and command line arguments. More...
 
 Tool (const std::string &name, const fs::path &binary, const std::string &arguments)
 Creates a named tool from a binary and command line arguments. More...
 
virtual ~Tool ()=default
 
Tooloperator= (const Tool &)=delete
 
Tooloperator= (Tool &&)=delete
 
std::string name () const
 Common name of this tool. More...
 
fs::path binary () const
 Full path to the binary. More...
 
const std::map< std::string, std::string > & attributes () const
 A set of attributes, for example compilation options. More...
 
std::vector< std::string > resolveDependencies () const
 Get dependencies of binary required to run it (via ldd) More...
 
std::size_t attributeHash () const
 Hash of the attributes. More...
 
virtual std::string getCommandline (const std::string &file) const
 Compose commandline for this tool and the given input file. More...
 
virtual std::string getCommandline (const std::string &file, const std::string &localBinary) const
 Compose commandline for this tool with another binary name and the given input file. More...
 
virtual std::optional< std::string > parseCommandline (const std::string &cmdline) const
 Compose commandline for this tool and the given input file. More...
 
virtual bool canHandle (const fs::path &) const
 Checks whether this cool can handle this file type. More...
 
virtual void additionalResults (const fs::path &, BenchmarkResult &) const
 Recover additional results from the tool output. More...
 

Protected Attributes

std::string mName
 (Non-unique) identifier for the tool. More...
 
fs::path mBinary
 Path to the binary. More...
 
std::string mArguments
 Command line arguments that should be passed to the binary. More...
 
std::map< std::string, std::string > mAttributes
 Attributes of the tool obtained by introspection of the binary. More...
 

Friends

bool operator< (const Tool &lhs, const Tool &rhs)
 Compare two tools. More...
 

Detailed Description

Base class for any tool.

A tool represents some executable that can be run with some input file. A tool is responsible for

  • deciding it is applicable for a given file extension,
  • building a command line to execute it and
  • parse additional results from stdout / stderr after it has run.

A tool is not to be copied or moved around but should only exist a single time.

Definition at line 38 of file Tool.h.

Constructor & Destructor Documentation

◆ Tool() [1/5]

benchmax::Tool::Tool ( )
delete

◆ Tool() [2/5]

benchmax::Tool::Tool ( const Tool )
delete

◆ Tool() [3/5]

benchmax::Tool::Tool ( Tool &&  )
delete

◆ Tool() [4/5]

benchmax::Tool::Tool ( const fs::path &  binary,
const std::string &  arguments 
)
inline

Creates a generic tool from a binary and command line arguments.

Definition at line 53 of file Tool.h.

◆ Tool() [5/5]

benchmax::Tool::Tool ( const std::string &  name,
const fs::path &  binary,
const std::string &  arguments 
)
inline

Creates a named tool from a binary and command line arguments.

Definition at line 55 of file Tool.h.

◆ ~Tool()

virtual benchmax::Tool::~Tool ( )
virtualdefault

Member Function Documentation

◆ additionalResults()

virtual void benchmax::Tool::additionalResults ( const fs::path &  ,
BenchmarkResult  
) const
inlinevirtual

Recover additional results from the tool output.

Reimplemented in benchmax::Z3, benchmax::SMTRAT_Analyzer, benchmax::SMTRAT, benchmax::Minisatp, benchmax::Minisat, and benchmax::MathSAT.

Definition at line 152 of file Tool.h.

Here is the caller graph for this function:

◆ attributeHash()

std::size_t benchmax::Tool::attributeHash ( ) const
inline

Hash of the attributes.

Definition at line 112 of file Tool.h.

◆ attributes()

const std::map<std::string,std::string>& benchmax::Tool::attributes ( ) const
inline

A set of attributes, for example compilation options.

Definition at line 72 of file Tool.h.

◆ binary()

fs::path benchmax::Tool::binary ( ) const
inline

Full path to the binary.

Definition at line 67 of file Tool.h.

Here is the caller graph for this function:

◆ canHandle()

virtual bool benchmax::Tool::canHandle ( const fs::path &  ) const
inlinevirtual

Checks whether this cool can handle this file type.

Reimplemented in benchmax::Z3, benchmax::SMTRAT_OPB, benchmax::SMTRAT_Analyzer, benchmax::SMTRAT, benchmax::Minisatp, benchmax::Minisat, and benchmax::MathSAT.

Definition at line 142 of file Tool.h.

Here is the caller graph for this function:

◆ getCommandline() [1/2]

virtual std::string benchmax::Tool::getCommandline ( const std::string &  file) const
inlinevirtual

Compose commandline for this tool and the given input file.

Definition at line 122 of file Tool.h.

Here is the caller graph for this function:

◆ getCommandline() [2/2]

virtual std::string benchmax::Tool::getCommandline ( const std::string &  file,
const std::string &  localBinary 
) const
inlinevirtual

Compose commandline for this tool with another binary name and the given input file.

Definition at line 126 of file Tool.h.

◆ name()

std::string benchmax::Tool::name ( ) const
inline

Common name of this tool.

Definition at line 62 of file Tool.h.

Here is the caller graph for this function:

◆ operator=() [1/2]

Tool& benchmax::Tool::operator= ( const Tool )
delete

◆ operator=() [2/2]

Tool& benchmax::Tool::operator= ( Tool &&  )
delete

◆ parseCommandline()

virtual std::optional<std::string> benchmax::Tool::parseCommandline ( const std::string &  cmdline) const
inlinevirtual

Compose commandline for this tool and the given input file.

Definition at line 130 of file Tool.h.

Here is the call graph for this function:

◆ resolveDependencies()

std::vector<std::string> benchmax::Tool::resolveDependencies ( ) const
inline

Get dependencies of binary required to run it (via ldd)

Definition at line 77 of file Tool.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<

bool operator< ( const Tool lhs,
const Tool rhs 
)
friend

Compare two tools.

Definition at line 147 of file Tool.h.

Field Documentation

◆ mArguments

std::string benchmax::Tool::mArguments
protected

Command line arguments that should be passed to the binary.

Definition at line 45 of file Tool.h.

◆ mAttributes

std::map<std::string,std::string> benchmax::Tool::mAttributes
protected

Attributes of the tool obtained by introspection of the binary.

Definition at line 47 of file Tool.h.

◆ mBinary

fs::path benchmax::Tool::mBinary
protected

Path to the binary.

Definition at line 43 of file Tool.h.

◆ mName

std::string benchmax::Tool::mName
protected

(Non-unique) identifier for the tool.

Definition at line 41 of file Tool.h.


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