Operators

inline void libsemigroups::Runner::kill() noexcept

Stop run from running (thread-safe).

This function can be used to terminate run() from another thread. After kill() has been called the Runner may no longer be in a valid state, but will return true from dead() .

See also

finished()

Parameters

(None)

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

(None).

inline void libsemigroups::Runner::run()

Run until finished.

Run the main algorithm implemented by a derived class derived of Runner.

Parameters

(None)

Returns

(None)

template<typename TIntType>
inline void libsemigroups::Runner::run_for(TIntType t)

Run for a specified amount of time.

For this to work it is necessary to periodically check if timed_out() returns true, and to stop if it is, in the run() member function of any derived class of Runner.

Parameters

t – the time to run for (in TIntType).

Returns

(None)

void libsemigroups::Runner::run_for(std::chrono::nanoseconds t)

Run for a specified amount of time.

For this to work it is necessary to periodically check if timed_out() returns true, and to stop if it is, in the run() member function of any derived class of Runner.

Parameters

t – the time in nanoseconds to run for.

Returns

(None)

template<typename T>
inline void libsemigroups::Runner::run_until(T &&func)

Run until a nullary predicate returns true or finished.

Parameters

func – a callable type that will exist for at least until this function returns, or a function pointer.

Returns

(None)

inline void libsemigroups::Runner::run_until(bool (*func)())

Run until a nullary predicate returns true or finished.

Parameters

func – a function pointer.

Returns

(None)

inline bool libsemigroups::Runner::running_for() const noexcept

Check if the runner is currently running for a particular length of time.

If the Runner is currently running because its member function run_for has been invoked, then this function returns true. Otherwise, false is returned.

Complexity

Constant.

Parameters

(None)

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A bool.

inline bool libsemigroups::Runner::running_until() const noexcept

Check if the runner is currently running until a nullary predicate returns true.

If the Runner is currently running because its member function run_until has been invoked, then this function returns true. Otherwise, false is returned.

Complexity

Constant.

Parameters

(None)

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A bool.