OutputHandler

class OutputHandler

Implement this interface to handle the outputs from the calls to any function that causes the underlying AMPL interpreter to display a message.

Note that errors and warnings are not passed through this interface, see ampl::ErrorHandler for more information.

Public Functions

virtual void output(output::Kind kind, const char *msg) = 0

This method is called when AMPL sends some output derived from executing a statement.

Parameters
  • kind: kind of the output of the AMPL interpreter
  • msg: text of the output by the AMPL interpreter

enum ampl::output::Kind

Represents the type of the output coming from the interpreter

Values:

WAITING

Output prompt2, returned when incomplete statements are interpreted.

BREAK

Output break, displayed when an operation is interrupted with SIGINT.

CD

Output cd, returned by the cd function.

DISPLAY

Output display, returned by the display function.

EXIT

Output exit, returned as last message from AMPL before exiting the interpreter.

EXPAND

Output expand, returned by the expand function.

LOAD

Output load, returned by the load function when loading a library.

OPTION

Output option, returned by the option function when getting the value of an option.

PRINT

Output print, returned by the print function when printing values from AMPL command line.

PROMPT

Output prompt1, normal AMPL prompt.

SOLUTION

Output solution, returned when loading a solution with the command solution, contains the solver message.

SOLVE

Output solve, returned by the solve function, contains the solver message.

SHOW

Output show, returned by the show function.

XREF

Output xref, returned by the xref function.

SHELL_OUTPUT

Output of the AMPL command shell

SHELL_MESSAGE

Messages from the command shell

MISC

Output misc

WRITE_TABLE

Messages from the command write table

READ_TABLE

Messages from the command read table

_READTABLE

Internal messages from the command read table

_WRITETABLE

Internal messages from the command write table

BREAKPOINT

Breakpoint hit.

CALL

Output of a script call

CHECK

Output of a check operation.

CLOSE

Output of a close command for output redirection.

COMMANDS

Output of a commands call into another file.

CONTINUE

Issued when continue is encountered.

DATA

Output of a data command.

DELETECMD

Output of a delete command.

DROP

Output of a drop command.

DROP_OR_RESTORE_ALL

Internal.

ELSE

Else block.

ELSE_CHECK

Internal.

ENDIF

End of if block.

ENVIRON

Output of a environ command.

FIX

Output of a fix command.

FOR

Output of a for command.

IF

Output of an if command.

LET

Output of a let command.

LOOPEND

End of loop.

OBJECTIVE

Output of an objective command.

OPTION_RESET

Occurs when resetting option values.

PRINTF

Output of a printf command.

PROBLEM

Output of a problem command.

PURGE

Output of a purge command.

RBRACE

Occurs when a right brace is encountered.

READ

Output of a read command.

RELOAD

Output of a reload command.

REMOVE

Output of a remove command.

REPEAT

Beginning of a repeat loop.

REPEAT_END

End of a repeat loop.

RESET

Output of a reset command.

RESTORE

Output of a restore command.

RUN_ARGS

Internal.

SEMICOLON

Internal.

SSTEP

Internal.

THEN

Beginning of the then part of an if statement.

UNFIX

Output of an unfix command.

UNLOAD

Output of an unload command.

UPDATE

Output of an update command.

WRITE

Output of a write command.