Clingo
Loading...
Searching...
No Matches
clingo_solve_event_handler Struct Reference

The solve event handler interface. More...

#include <solve.h>

Public Attributes

bool(* model )(clingo_model_t *model, void *data, bool *goon)
 Call back to intercept models.
 
bool(* unsat )(int64_t const *values, size_t size, void *data)
 Callback to interept lower bounds.
 
bool(* stats )(clingo_stats_t *stats, void *data)
 Callback to extend statistics.
 
void(* finish )(clingo_solve_result_bitset_t result, void *data)
 Callback to notify that the search has finished.
 
void(* free )(void *data)
 Callback to free the userdata of the handler.
 

Detailed Description

The solve event handler interface.

Examples
control.c.

Member Data Documentation

◆ finish

void(* clingo_solve_event_handler::finish) (clingo_solve_result_bitset_t result, void *data)

Callback to notify that the search has finished.

This can be used for thread synchronization as the function is not called in the main thread when solving asynchronously.

Parameters
resultthe solve result
datathe user data

◆ free

void(* clingo_solve_event_handler::free) (void *data)

Callback to free the userdata of the handler.

Parameters
datathe user data

◆ model

bool(* clingo_solve_event_handler::model) (clingo_model_t *model, void *data, bool *goon)

Call back to intercept models.

Parameters
modelthe model
datathe user data
goonwhether to stop or continue
Returns
whether the call was successful

◆ stats

bool(* clingo_solve_event_handler::stats) (clingo_stats_t *stats, void *data)

Callback to extend statistics.

Parameters
statsthe stats object
datathe user data
Returns
whether the call was successful

◆ unsat

bool(* clingo_solve_event_handler::unsat) (int64_t const *values, size_t size, void *data)

Callback to interept lower bounds.

Parameters
valuesthe values of the current lower bound
sizethe number of values in the lower bound
datathe user data
Returns
whether the call was successful

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