OutputHandler

class ampl::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:

enumerator WAITING

Output prompt2, returned when incomplete statements are interpreted.

enumerator BREAK

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

enumerator CD

Output cd, returned by the cd function.

enumerator DISPLAY

Output display, returned by the display function.

enumerator EXIT

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

enumerator EXPAND

Output expand, returned by the expand function.

enumerator LOAD

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

enumerator OPTION

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

enumerator PRINT

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

enumerator PROMPT

Output prompt1, normal AMPL prompt.

enumerator SOLUTION

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

enumerator SOLVE

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

enumerator SHOW

Output show, returned by the show function.

enumerator XREF

Output xref, returned by the xref function.

enumerator SHELL_OUTPUT

Output of the AMPL command shell

enumerator SHELL_MESSAGE

Messages from the command shell

enumerator MISC

Output misc

enumerator WRITE_TABLE

Messages from the command write table

enumerator READ_TABLE

Messages from the command read table

enumerator _READTABLE

Internal messages from the command read table

enumerator _WRITETABLE

Internal messages from the command write table

enumerator BREAKPOINT

Breakpoint hit.

enumerator CALL

Output of a script call

enumerator CHECK

Output of a check operation.

enumerator CLOSE

Output of a close command for output redirection.

enumerator COMMANDS

Output of a commands call into another file.

enumerator CONTINUE

Issued when continue is encountered.

enumerator DATA

Output of a data command.

enumerator DELETECMD

Output of a delete command.

enumerator DROP

Output of a drop command.

enumerator DROP_OR_RESTORE_ALL

Internal.

enumerator ELSE

Else block.

enumerator ELSE_CHECK

Internal.

enumerator ENDIF

End of if block.

enumerator ENVIRON

Output of a environ command.

enumerator FIX

Output of a fix command.

enumerator FOR

Output of a for command.

enumerator IF

Output of an if command.

enumerator LET

Output of a let command.

enumerator LOOPEND

End of loop.

enumerator OBJECTIVE

Output of an objective command.

enumerator OPTION_RESET

Occurs when resetting option values.

enumerator PRINTF

Output of a printf command.

enumerator PROBLEM

Output of a problem command.

enumerator PURGE

Output of a purge command.

enumerator RBRACE

Occurs when a right brace is encountered.

enumerator READ

Output of a read command.

enumerator RELOAD

Output of a reload command.

enumerator REMOVE

Output of a remove command.

enumerator REPEAT

Beginning of a repeat loop.

enumerator REPEAT_END

End of a repeat loop.

enumerator RESET

Output of a reset command.

enumerator RESTORE

Output of a restore command.

enumerator RUN_ARGS

Internal.

enumerator SEMICOLON

Internal.

enumerator SSTEP

Internal.

enumerator THEN

Beginning of the then part of an if statement.

enumerator UNFIX

Output of an unfix command.

enumerator UNLOAD

Output of an unload command.

enumerator UPDATE

Output of an update command.

enumerator WRITE

Output of a write command.