Skip to main content
FRAMES NO FRAMES

Class IloOplErrorHandler

Definition file: ilopl/ilooplerrorhandler.h
Map of IloOplErrorHandlerIloOplErrorHandlerIloOplErrorHandler
Interface for error handling.

Instances of this class are used by OPL to notify errors and warnings.

The default implementation will write messages to cout or an alternate stream given to the constructor.

A custom implementation can be used to intercept those messages and display them differently. Useful for embedding OPL into other applications. Refer also to the Interfaces User's Manual.

See Also:

Method Summary
public voidabort()
public voidend()
public voiderror(const IloOplMessage & message, IloOplLocation location)
public voidfatal(const IloOplMessage & message, IloOplLocation location)
public IloOplErrorHandler(IloOplErrorHandlerBaseI * impl)
public IloOplErrorHandler(IloEnv env, std::ostream & outs)
public IloBoolok() const
public voidwarning(const IloOplMessage & message, IloOplLocation location)
Method Detail

IloOplErrorHandler

public IloOplErrorHandler(IloOplErrorHandlerBaseI * impl)

This constructor creates an error handler from an existing implementation object.


IloOplErrorHandler

public IloOplErrorHandler(IloEnv env, std::ostream & outs)

This constructor creates a default error handler, reporting to a stream.

Parameters:

env
The environment used for allocation.
outs
The stream to which messages are written.

abort

public void abort()

This member function stops the current OPL process.

An exception of type IloOplAbort, extending IloOplException will be raised. OPL does so as soon as possible.

This mechanism applies to OPL processing only, including scripting. It does not stop Concert, CPLEX, or CP processing.


end

public void end()

Clears the memory used by this object


error

public void error(const IloOplMessage & message, IloOplLocation location)

This member function reports an error.

OPL tries to continue processing as long as possible after errors were handled.

See Also:

Parameters:

message
The message to report.
location
The location where the event causing the error occurred.

fatal

public void fatal(const IloOplMessage & message, IloOplLocation location)

This member function reports a fatal error message.

Fatal errors will stop OPL processing immediatly.

See Also:

Parameters:

message
The message to report.
location
The location where the event causing the fatal error occurred.

Returns:

A fatal error message.

ok

public IloBool ok() const

This member function tells you whether errors were reported.

Returns:

IloTrue if no errors were reported.

warning

public void warning(const IloOplMessage & message, IloOplLocation location)

This member function reports a warning.

Warnings draw the attention to uncommon situations, they can be switched off using OPL settings.

See Also:

Parameters:

message
The message to report.
location
The location where the event causing the warning occurred.