clingo
|
#include <clasp_app.h>
Public Types | |
typedef ClaspFacade::Summary | RunSummary |
typedef ProgramOptions::PosOption | PosOption |
Public Types inherited from ProgramOptions::Application | |
typedef std::pair< const char *, unsigned > | HelpOpt |
Description of and max value for help option. More... | |
Protected Types | |
typedef SingleOwnerPtr< Output > | OutPtr |
typedef SingleOwnerPtr < ClaspFacade > | ClaspPtr |
Protected Member Functions | |
ClaspAppBase () | |
~ClaspAppBase () | |
virtual ProblemType | getProblemType ()=0 |
virtual void | run (ClaspFacade &clasp)=0 |
virtual Output * | createOutput (ProblemType f) |
virtual void | storeCommandArgs (const ProgramOptions::ParsedValues &values) |
bool | handlePostGroundOptions (ProgramBuilder &prg) |
bool | handlePreSolveOptions (ClaspFacade &clasp) |
virtual const int * | getSignals () const |
Returns a null-terminated array of signals that this application handles. More... | |
virtual HelpOpt | getHelpOption () const |
Returns the application's help option and its description. More... | |
virtual PosOption | getPositional () const |
Returns the parser function for handling positional options. More... | |
virtual void | initOptions (ProgramOptions::OptionContext &root) |
Adds all application options to the given context. More... | |
virtual void | validateOptions (const ProgramOptions::OptionContext &root, const ProgramOptions::ParsedOptions &parsed, const ProgramOptions::ParsedValues &values) |
Validates parsed options. Shall throw to signal error. More... | |
virtual void | setup () |
Called once after option processing is done. More... | |
virtual void | run () |
Shall run the application. Called after setup and option processing. More... | |
virtual void | shutdown () |
Called after run returned. The default is a noop. More... | |
virtual bool | onSignal (int) |
Called when a signal is received. Tthe default terminates the application. More... | |
virtual void | printHelp (const ProgramOptions::OptionContext &root) |
Prints the application's help information (called if options contain '–help'). More... | |
virtual void | printVersion () |
Prints the application's version message (called if options contain '–version'). More... | |
virtual void | onEvent (const Event &ev) |
virtual bool | onModel (const Solver &s, const Model &m) |
int | exitCode (const RunSummary &sol) const |
void | printTemplate () const |
void | printDefaultConfigs () const |
void | printLibClaspVersion () const |
std::istream & | getStream () |
void | readLemmas (SharedContext &ctx) |
void | writeNonHcfs (const SharedDependencyGraph &graph) const |
Protected Member Functions inherited from ProgramOptions::Application | |
Application () | |
virtual | ~Application () |
void | shutdown (bool hasError) |
void | exit (int exitCode) const |
unsigned | verbose () const |
void | setVerbose (unsigned v) |
void | killAlarm () |
int | blockSignals () |
void | unblockSignals (bool deliverPending) |
void | processSignal (int sigNum) |
virtual void | onUnhandledException () |
Called on an exception from run(). The default terminates the application. More... | |
Static Protected Member Functions | |
static bool | parsePositional (const std::string &s, std::string &out) |
Protected Attributes | |
ClaspCliConfig | claspConfig_ |
ClaspAppOptions | claspAppOpts_ |
ClaspPtr | clasp_ |
OutPtr | out_ |
Additional Inherited Members | |
Public Member Functions inherited from ProgramOptions::Application | |
virtual const char * | getName () const =0 |
Returns the name of this application. More... | |
virtual const char * | getVersion () const =0 |
Returns the version number of this application. More... | |
virtual const char * | getUsage () const |
Returns the usage information of this application. More... | |
virtual void | error (const char *msg) const |
Prints the given error message to stderr. More... | |
virtual void | info (const char *msg) const |
Prints the given info message to stderr. More... | |
virtual void | warn (const char *msg) const |
Prints the given warning message to stderr. More... | |
int | main (int argc, char **argv) |
Runs this application with the given command-line arguments. More... | |
void | setExitCode (int n) |
Sets the value that should be returned as the application's exit code. More... | |
int | getExitCode () const |
Returns the application's exit code. More... | |
virtual void | printUsage () |
Prints the application's usage message (default is: "usage: getName() getUsage()"). More... | |
Public Member Functions inherited from Clasp::EventHandler | |
EventHandler (Event::Verbosity verbosity=Event::verbosity_quiet) | |
virtual | ~EventHandler () |
void | setVerbosity (Event::Subsystem sys, Event::Verbosity verb) |
void | dispatch (const Event &ev) |
Static Public Member Functions inherited from ProgramOptions::Application | |
static Application * | getInstance () |
Returns the application object that is running. More... | |
|
protected |
|
protected |
typedef ProgramOptions::PosOption Clasp::Cli::ClaspAppBase::PosOption |
|
protected |
|
protected |
|
protectedvirtual |
|
protected |
|
inlineprotectedvirtual |
Returns the application's help option and its description.
Reimplemented from ProgramOptions::Application.
|
inlineprotectedvirtual |
Returns the parser function for handling positional options.
Reimplemented from ProgramOptions::Application.
|
protectedpure virtual |
Implemented in Clasp::Cli::ClaspApp, and ClingoApp.
|
protectedvirtual |
Returns a null-terminated array of signals that this application handles.
Reimplemented from ProgramOptions::Application.
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
Adds all application options to the given context.
Implements ProgramOptions::Application.
Reimplemented in ClingoApp.
|
protectedvirtual |
Reimplemented from Clasp::EventHandler.
Reimplemented in ClingoApp.
Reimplemented from Clasp::EventHandler.
Reimplemented in ClingoApp.
|
protectedvirtual |
Called when a signal is received. Tthe default terminates the application.
Reimplemented from ProgramOptions::Application.
|
staticprotected |
|
protected |
|
protectedvirtual |
Prints the application's help information (called if options contain '–help').
Reimplemented from ProgramOptions::Application.
Reimplemented in Clasp::Cli::ClaspApp, and ClingoApp.
|
protected |
|
protected |
|
protectedvirtual |
Prints the application's version message (called if options contain '–version').
Reimplemented from ProgramOptions::Application.
Reimplemented in ClingoApp.
|
protected |
|
protectedpure virtual |
|
protectedvirtual |
Shall run the application. Called after setup and option processing.
Implements ProgramOptions::Application.
|
protectedvirtual |
Called once after option processing is done.
Implements ProgramOptions::Application.
|
protectedvirtual |
Called after run returned. The default is a noop.
Reimplemented from ProgramOptions::Application.
Reimplemented in ClingoApp.
|
protectedvirtual |
|
protectedvirtual |
Validates parsed options. Shall throw to signal error.
Implements ProgramOptions::Application.
Reimplemented in ClingoApp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |