Clingo
Loading...
Searching...
No Matches
Clingo::App Class Reference

Interface to build applications on top of clingo. More...

#include <app.hh>

Public Member Functions

 App ()=default
 The default constructor.
 
 App (App &&other)=delete
 Disable copying and moving.
 
virtual ~App ()=default
 The default destructor.
 
auto program_name () noexcept -> std::string_view
 Get the name of the application.
 
auto program_version () noexcept -> std::string_view
 Get the version of the application.
 
void main (Control const &control, std::span< std::string_view const > files)
 Run the main control flow.
 
void print_model (ConstModel model, ModelPrinter const &printer)
 Customize model printing.
 
void register_options (Options options)
 Optionally register additional application options.
 
void validate_options ()
 Validate previously parsed options.
 

Detailed Description

Interface to build applications on top of clingo.

Member Function Documentation

◆ main()

void Clingo::App::main ( Control const control,
std::span< std::string_view const files 
)
inline

Run the main control flow.

Does nothing by default.

Parameters
controlthe control object
filesthe files to parse

◆ print_model()

void Clingo::App::print_model ( ConstModel  model,
ModelPrinter const printer 
)
inline

Customize model printing.

Calls the default model printer by default.

Parameters
modelthe current model
printerthe default model printer

◆ program_name()

auto Clingo::App::program_name ( ) -> std::string_view
inlinenoexcept

Get the name of the application.

Returns "clingo" by default.

Returns
the name

◆ program_version()

auto Clingo::App::program_version ( ) -> std::string_view
inlinenoexcept

Get the version of the application.

Returns the clingo version by default.

Returns
the version

◆ register_options()

void Clingo::App::register_options ( Options  options)
inline

Optionally register additional application options.

Parameters
optionsthe options object

◆ validate_options()

void Clingo::App::validate_options ( )
inline

Validate previously parsed options.

Should throw std::invalid_value if conflicting options are found.


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