clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Types | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Clasp::Cli::ClaspAppBase Class Referenceabstract

#include <clasp_app.h>

Inheritance diagram for Clasp::Cli::ClaspAppBase:
Inheritance graph
Collaboration diagram for Clasp::Cli::ClaspAppBase:
Collaboration graph

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< OutputOutPtr
 
typedef SingleOwnerPtr
< ClaspFacade
ClaspPtr
 

Protected Member Functions

 ClaspAppBase ()
 
 ~ClaspAppBase ()
 
virtual ProblemType getProblemType ()=0
 
virtual void run (ClaspFacade &clasp)=0
 
virtual OutputcreateOutput (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 ApplicationgetInstance ()
 Returns the application object that is running. More...
 

Member Typedef Documentation

typedef ProgramOptions::PosOption Clasp::Cli::ClaspAppBase::PosOption

Constructor & Destructor Documentation

Clasp::Cli::ClaspAppBase::ClaspAppBase ( )
protected
Clasp::Cli::ClaspAppBase::~ClaspAppBase ( )
protected

Member Function Documentation

Output * Clasp::Cli::ClaspAppBase::createOutput ( ProblemType  f)
protectedvirtual

Reimplemented in ClingoApp.

Here is the call graph for this function:

int Clasp::Cli::ClaspAppBase::exitCode ( const RunSummary sol) const
protected

Here is the call graph for this function:

virtual HelpOpt Clasp::Cli::ClaspAppBase::getHelpOption ( ) const
inlineprotectedvirtual

Returns the application's help option and its description.

Reimplemented from ProgramOptions::Application.

virtual PosOption Clasp::Cli::ClaspAppBase::getPositional ( ) const
inlineprotectedvirtual

Returns the parser function for handling positional options.

Reimplemented from ProgramOptions::Application.

Here is the call graph for this function:

virtual ProblemType Clasp::Cli::ClaspAppBase::getProblemType ( )
protectedpure virtual

Implemented in Clasp::Cli::ClaspApp, and ClingoApp.

const int * Clasp::Cli::ClaspAppBase::getSignals ( ) const
protectedvirtual

Returns a null-terminated array of signals that this application handles.

Reimplemented from ProgramOptions::Application.

std::istream & Clasp::Cli::ClaspAppBase::getStream ( )
protected

Here is the call graph for this function:

bool Clasp::Cli::ClaspAppBase::handlePostGroundOptions ( ProgramBuilder prg)
protected

Here is the call graph for this function:

bool Clasp::Cli::ClaspAppBase::handlePreSolveOptions ( ClaspFacade clasp)
protected

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::initOptions ( ProgramOptions::OptionContext root)
protectedvirtual

Adds all application options to the given context.

Implements ProgramOptions::Application.

Reimplemented in ClingoApp.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::onEvent ( const Event ev)
protectedvirtual

Reimplemented from Clasp::EventHandler.

Reimplemented in ClingoApp.

Here is the call graph for this function:

bool Clasp::Cli::ClaspAppBase::onModel ( const Solver s,
const Model m 
)
protectedvirtual

Reimplemented from Clasp::EventHandler.

Reimplemented in ClingoApp.

bool Clasp::Cli::ClaspAppBase::onSignal ( int  x)
protectedvirtual

Called when a signal is received. Tthe default terminates the application.

Reimplemented from ProgramOptions::Application.

bool Clasp::Cli::ClaspAppBase::parsePositional ( const std::string &  s,
std::string &  out 
)
staticprotected

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::printDefaultConfigs ( ) const
protected

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::printHelp ( const ProgramOptions::OptionContext root)
protectedvirtual

Prints the application's help information (called if options contain '–help').

Reimplemented from ProgramOptions::Application.

Reimplemented in Clasp::Cli::ClaspApp, and ClingoApp.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::printLibClaspVersion ( ) const
protected
void Clasp::Cli::ClaspAppBase::printTemplate ( ) const
protected

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::printVersion ( )
protectedvirtual

Prints the application's version message (called if options contain '–version').

Reimplemented from ProgramOptions::Application.

Reimplemented in ClingoApp.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::readLemmas ( SharedContext ctx)
protected

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::run ( ClaspFacade clasp)
protectedpure virtual

Implemented in Clasp::Cli::ClaspApp, and ClingoApp.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::run ( )
protectedvirtual

Shall run the application. Called after setup and option processing.

Implements ProgramOptions::Application.

void Clasp::Cli::ClaspAppBase::setup ( )
protectedvirtual

Called once after option processing is done.

Implements ProgramOptions::Application.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::shutdown ( )
protectedvirtual

Called after run returned. The default is a noop.

Reimplemented from ProgramOptions::Application.

Reimplemented in ClingoApp.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::storeCommandArgs ( const ProgramOptions::ParsedValues values)
protectedvirtual
void Clasp::Cli::ClaspAppBase::validateOptions ( const ProgramOptions::OptionContext root,
const ProgramOptions::ParsedOptions parsed,
const ProgramOptions::ParsedValues values 
)
protectedvirtual

Validates parsed options. Shall throw to signal error.

Implements ProgramOptions::Application.

Reimplemented in ClingoApp.

Here is the call graph for this function:

void Clasp::Cli::ClaspAppBase::writeNonHcfs ( const SharedDependencyGraph graph) const
protected

Here is the call graph for this function:

Member Data Documentation

ClaspPtr Clasp::Cli::ClaspAppBase::clasp_
protected
ClaspAppOptions Clasp::Cli::ClaspAppBase::claspAppOpts_
protected
ClaspCliConfig Clasp::Cli::ClaspAppBase::claspConfig_
protected
OutPtr Clasp::Cli::ClaspAppBase::out_
protected

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