|
Clingo
|
A handle for asynchronous grounding. More...
#include <solver.hh>
Public Member Functions | |
| GroundHandle (Solver &solver, Input::ProgramParamVec params, UGroundEventHandler handler) | |
| Start grounding with the given params and context. | |
| ~GroundHandle () noexcept | |
| Destroy the ground handle. | |
| GroundHandle (GroundHandle const &other)=delete | |
| Prevent copying. | |
| GroundHandle (GroundHandle &&other) noexcept | |
| Enable moving. | |
| auto | operator= (GroundHandle &&other) noexcept -> GroundHandle & |
| Enable moving. | |
| auto | operator= (GroundHandle const &other) -> GroundHandle &=delete |
| Prevent copying. | |
| auto | wait (double timeout) -> bool |
| Wait for grounding to finish. | |
| auto | get () -> GroundResult |
| Get the result of grounding. | |
| void | cancel () |
| Stop grounding. | |
A handle for asynchronous grounding.
The handle can be moved but not copied.
|
noexcept |
Destroy the ground handle.
If grounding has not stopped yet, this requests grounding to stop and joins the grounding thread.
| void CppClingo::Control::GroundHandle::cancel | ( | ) |
Stop grounding.
Blocks until grounding has finished.
| auto CppClingo::Control::GroundHandle::get | ( | ) | -> GroundResult |
Get the result of grounding.
Blocks until grounding has finished. Raises exceptions thrown during grounding.
| auto CppClingo::Control::GroundHandle::wait | ( | double | timeout | ) | -> bool |
Wait for grounding to finish.
If the timeout is greater than zero, the method blocks for at most timeout seconds. If the timeout is zero, the method does not block. If the timeout is negative, the method blocks until grounding has finished.
The function returns true if grounding has finished, false otherwise.
| timeout | The maximum time to wait in seconds. |