GLPK for C#/CLI  1.10.0
All Classes Namespaces Functions Properties Pages
Static Public Member Functions | List of all members
org.gnu.glpk.GlpkTerminal Class Reference

This class manages terminal output. More...

Collaboration diagram for org.gnu.glpk.GlpkTerminal:
Collaboration graph

Static Public Member Functions

static int callback (string str)
 Callback function called by native library. More...
 
static void addListener (IGlpkTerminalListener listener)
 Adds a listener for callbacks. More...
 
static bool removeListener (IGlpkTerminalListener listener)
 Removes first occurance of a listener for callbacks. More...
 

Detailed Description

This class manages terminal output.

An object can be registered as listener for terminal output using the addListener method.

GLPK will call method callback before producing terminal output. The listeners.Value can inhibit the terminal output by returning false in the output routine.

The listener list is stored in thread local storage. Each thread has to register its own listener.

If a GlpkExeption has occured it is necessary to call

GLPK.glp_term_hook(null, null);

to reenable listening to terminal output.

See also
IGlpkTerminalListener
GlpkException
GLPK::glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int, SWIGTYPE_p_void)

Definition at line 26 of file GlpkTerminal.cs.

Member Function Documentation

◆ addListener()

static void org.gnu.glpk.GlpkTerminal.addListener ( IGlpkTerminalListener  listener)
inlinestatic

Adds a listener for callbacks.

Parameters
listenerlistener for callbacks

Definition at line 69 of file GlpkTerminal.cs.

Here is the call graph for this function:

◆ callback()

static int org.gnu.glpk.GlpkTerminal.callback ( string  str)
inlinestatic

Callback function called by native library.

Output to the console is created if any of the listeners.Value requests it.

Parameters
strstring to be written to console
Returns
0 if output is requested

Definition at line 49 of file GlpkTerminal.cs.

Here is the call graph for this function:

◆ removeListener()

static bool org.gnu.glpk.GlpkTerminal.removeListener ( IGlpkTerminalListener  listener)
inlinestatic

Removes first occurance of a listener for callbacks.

Parameters
listenerlistener for callbacks
Returns
true if the listener was found

Definition at line 79 of file GlpkTerminal.cs.


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