Closed BenKaufmann closed 6 months ago
However, I think it is not quite the same. This would break systems, which want to print something after clasp printed its model. Now they can only print something before if they want to use the default printer. Systems like clingcon or clingo-lpx won't be affected because there I took over printing completely but it is still a break.
Hm, I'm obviously missing something then.
From my understanding, both versions should do the same.
CustomTextOutput
if there is a printer, i.e. app_->has_printer()
is true.CustomTextOutput
directly replaced the base classe's printModel()
function (with a nearly verbatim copy) and:
printValues()
of the base class. x == optQ()
, printMeta()
of the base class was invokedTextOutput
gained a new virtual function printModelValues()
, which is called from TextOutput::printModel()
only after the "should we print this model" check returned true.
CustomTextOutput
then calls printModelValues()
of the base class, which (as previously) calls printValues()
.x == optQ()
, printMeta()
is invoked from the base class implementation of printModel()
.Could you please help me figure out where I went wrong?
@rkaminsk Sorry for the noise. Postponing the call to printModelValues()
to after the callback has finished is already a breaking change :disappointed:
EDIT: I updated the PR. Does this address your concern?
Now it looks like it was before sans the copied code. I think it can be merged like this.
CustomTextOutput