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

#include <clasp_output.h>

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

Public Types

enum  PrintLevel { print_all = 0, print_best = 1, print_no = 2 }
 Supported levels for printing models, optimize values, and individual calls. More...
 

Public Member Functions

 Output (uint32 verb=1)
 
virtual ~Output ()
 
uint32 verbosity () const
 Active verbosity level. More...
 
bool quiet () const
 Do not output any models? More...
 
int modelQ () const
 Print level for models. More...
 
int optQ () const
 Print level for optimization values. More...
 
int callQ () const
 Print level for individual (solve) calls. More...
 
void setVerbosity (uint32 verb)
 
void setModelQuiet (PrintLevel model)
 
void setOptQuiet (PrintLevel opt)
 
void setCallQuiet (PrintLevel call)
 
void setHide (char c)
 
virtual void run (const char *solver, const char *version, const std::string *begInput, const std::string *endInput)=0
 Shall be called once on startup. More...
 
virtual void shutdown (const ClaspFacade::Summary &summary)
 Shall be called once on shutdown. More...
 
virtual void shutdown ()=0
 
virtual void onEvent (const Event &ev)
 Handles ClaspFacade events by forwarding calls to startStep() and stopStep(). More...
 
virtual bool onModel (const Solver &s, const Model &m)
 Checks quiet-levels and forwards to printModel() if appropriate. More...
 
virtual void printModel (const SymbolTable &sym, const Model &m, PrintLevel x)=0
 Shall print the given model. More...
 
virtual void startStep (const ClaspFacade &)
 A solving step has started. More...
 
virtual void stopStep (const ClaspFacade::Summary &summary)
 A solving step has stopped. More...
 
virtual void printSummary (const ClaspFacade::Summary &summary, bool final)=0
 Shall print the given summary. More...
 
virtual void printStatistics (const ClaspFacade::Summary &summary, bool final)=0
 Shall print the given statistics. 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)
 

Protected Member Functions

const ModelgetModel () const
 
void saveModel (const Model &m)
 
void clearModel ()
 
bool doPrint (const SymbolTable::symbol_type &sym) const
 

Detailed Description

Interface for printing status and input format dependent information, like models, optimization values, and summaries.

Member Enumeration Documentation

Supported levels for printing models, optimize values, and individual calls.

Enumerator
print_all 

Print all models, optimize values, or calls.

print_best 

Only print last model, optimize value, or call.

print_no 

Do not print any models, optimize values, or calls.

Constructor & Destructor Documentation

Clasp::Cli::Output::Output ( uint32  verb = 1)
explicit

Here is the call graph for this function:

Clasp::Cli::Output::~Output ( )
virtual

Member Function Documentation

int Clasp::Cli::Output::callQ ( ) const
inline

Print level for individual (solve) calls.

void Clasp::Cli::Output::clearModel ( )
inlineprotected
bool Clasp::Cli::Output::doPrint ( const SymbolTable::symbol_type sym) const
inlineprotected
const Model* Clasp::Cli::Output::getModel ( ) const
inlineprotected
int Clasp::Cli::Output::modelQ ( ) const
inline

Print level for models.

void Clasp::Cli::Output::onEvent ( const Event ev)
virtual

Handles ClaspFacade events by forwarding calls to startStep() and stopStep().

Reimplemented from Clasp::EventHandler.

Reimplemented in Clasp::Cli::TextOutput.

Here is the call graph for this function:

bool Clasp::Cli::Output::onModel ( const Solver s,
const Model m 
)
virtual

Checks quiet-levels and forwards to printModel() if appropriate.

Reimplemented from Clasp::EventHandler.

Here is the call graph for this function:

int Clasp::Cli::Output::optQ ( ) const
inline

Print level for optimization values.

virtual void Clasp::Cli::Output::printModel ( const SymbolTable sym,
const Model m,
PrintLevel  x 
)
pure virtual

Shall print the given model.

Implemented in Clasp::Cli::TextOutput.

virtual void Clasp::Cli::Output::printStatistics ( const ClaspFacade::Summary summary,
bool  final 
)
pure virtual

Shall print the given statistics.

Implemented in Clasp::Cli::TextOutput, and Clasp::Cli::JsonOutput.

virtual void Clasp::Cli::Output::printSummary ( const ClaspFacade::Summary summary,
bool  final 
)
pure virtual

Shall print the given summary.

Implemented in Clasp::Cli::TextOutput, and Clasp::Cli::JsonOutput.

bool Clasp::Cli::Output::quiet ( ) const
inline

Do not output any models?

Here is the call graph for this function:

virtual void Clasp::Cli::Output::run ( const char *  solver,
const char *  version,
const std::string *  begInput,
const std::string *  endInput 
)
pure virtual

Shall be called once on startup.

Implemented in Clasp::Cli::TextOutput, and Clasp::Cli::JsonOutput.

void Clasp::Cli::Output::saveModel ( const Model m)
protected
void Clasp::Cli::Output::setCallQuiet ( PrintLevel  call)
void Clasp::Cli::Output::setHide ( char  c)
void Clasp::Cli::Output::setModelQuiet ( PrintLevel  model)
void Clasp::Cli::Output::setOptQuiet ( PrintLevel  opt)
void Clasp::Cli::Output::setVerbosity ( uint32  verb)

Here is the call graph for this function:

void Clasp::Cli::Output::shutdown ( const ClaspFacade::Summary summary)
virtual

Shall be called once on shutdown.

Reimplemented in Clasp::Cli::JsonOutput.

Here is the call graph for this function:

virtual void Clasp::Cli::Output::shutdown ( )
pure virtual
void Clasp::Cli::Output::startStep ( const ClaspFacade )
virtual

A solving step has started.

Reimplemented in Clasp::Cli::TextOutput.

Here is the call graph for this function:

void Clasp::Cli::Output::stopStep ( const ClaspFacade::Summary summary)
virtual

A solving step has stopped.

Here is the call graph for this function:

uint32 Clasp::Cli::Output::verbosity ( ) const
inline

Active verbosity level.


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