$darkmode
abort.hpp File Reference
#include <atomic>
#include <stdexcept>
Include dependency graph for abort.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cloe::AsyncAbort
 

Typedefs

using cloe::AbortFlag = std::atomic_bool
 

Functions

void cloe::abort_checkpoint (AbortFlag &sig)
 

Detailed Description

See also
cloe/core.hpp

Typedef Documentation

◆ AbortFlag

using cloe::AbortFlag = typedef std::atomic_bool

AbortFlag can be included in a plugin to allow asynchronous aborts to be signalled.

The abort() method of a plugin can be called asynchronously and should simply store true in the AbortFlag:

abort_flag.store(true);

Function Documentation

◆ abort_checkpoint()

void cloe::abort_checkpoint ( AbortFlag sig)
inline

Create an abort checkpoint.

In places where the plugin code might spin for longer periods, the abort_checkpoint() function can be utilized to provide a place to escape. This will throw the AsyncAbort exception, which should be caught by the simulation framework.

Here is the call graph for this function:
Here is the caller graph for this function: