2 using System.Collections.Generic;
5 namespace org.gnu.glpk {
31 private static ThreadLocal<LinkedList<IGlpkTerminalListener>> listeners
32 =
new ThreadLocal<LinkedList<IGlpkTerminalListener>>(() =>
34 return new LinkedList<IGlpkTerminalListener>();
52 if (listeners.Value.Count > 0) {
54 output |= listener.
output(str);
71 listeners.Value.AddLast(listener);
80 if (listeners.Value.Contains(listener)) {
81 listeners.Value.Remove(listener);
static void addListener(IGlpkTerminalListener listener)
Adds a listener for callbacks.
bool output(string str)
Receive terminal output.
static bool removeListener(IGlpkTerminalListener listener)
Removes first occurance of a listener for callbacks.
static void glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int func, SWIGTYPE_p_void info)
glp_term_hook - install hook to intercept terminal output .
static int callback(string str)
Callback function called by native library.
This class manages terminal output.