using System; using System.Collections.Generic; using System.Threading; namespace org.gnu.glpk { /** * This class manages terminal output. *
An object can be registered as listener for terminal output using * the {@link #addListener(IGlpkTerminalListener) addListener} method. *
GLPK will call method {@link #callback(string) callback} before producing
* terminal output. The listeners.Value can inhibit the terminal output by returning
* false in the {@link IGlpkTerminalListener#output(string) output}
* routine.
*
The listener list is stored in thread local storage. Each thread has to * register its own listener. *
If a {@link GlpkException GlpkExeption} has occured it is necessary to * call
* GLPK.glp_term_hook(null, null);
* to reenable listening to terminal output.
* @see IGlpkTerminalListener
* @see GlpkException
* @see GLPK#glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int,
* SWIGTYPE_p_void)
*/
public class GlpkTerminal {
/**
* List of callback listeners.
*/
private static ThreadLocal