Hegel 0.13.1
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::stateful::ConcurrentRule< M > Class Template Reference

An action that a worker can apply to a concurrent state machine. More...

#include <stateful.h>

Public Types

using Function = std::function<void(TestCase&, M&)>
 The type of the function that applies the rule.

Public Member Functions

 ConcurrentRule (std::string name, Function function)
 Creates a rule in anonymous_group.
 ConcurrentRule (std::string name, std::string group, Function function)
 Creates a rule in the specified group.
const std::string & name () const
 Returns the name of the rule.
const std::string & group () const
 Returns the concurrency group of the rule.
const Function & function () const
 Returns the function that applies the rule.

Detailed Description

template<typename M>
class hegel::stateful::ConcurrentRule< M >

An action that a worker can apply to a concurrent state machine.

Rules in the same group can run concurrently. Rules in different groups cannot. A rule that does not specify a group uses anonymous_group.

Template Parameters
MThe state-machine type that the rule acts on

Constructor & Destructor Documentation

◆ ConcurrentRule() [1/2]

template<typename M>
hegel::stateful::ConcurrentRule< M >::ConcurrentRule ( std::string name,
Function function )
inline

Creates a rule in anonymous_group.

Parameters
nameThe name of the rule
functionThe function that applies the rule

◆ ConcurrentRule() [2/2]

template<typename M>
hegel::stateful::ConcurrentRule< M >::ConcurrentRule ( std::string name,
std::string group,
Function function )
inline

Creates a rule in the specified group.

Parameters
nameThe name of the rule
groupThe concurrency group of the rule
functionThe function that applies the rule

Member Function Documentation

◆ function()

template<typename M>
const Function & hegel::stateful::ConcurrentRule< M >::function ( ) const
inline

Returns the function that applies the rule.

Returns
The function that applies the rule

◆ group()

template<typename M>
const std::string & hegel::stateful::ConcurrentRule< M >::group ( ) const
inline

Returns the concurrency group of the rule.

Returns
The concurrency group of the rule

◆ name()

template<typename M>
const std::string & hegel::stateful::ConcurrentRule< M >::name ( ) const
inline

Returns the name of the rule.

Returns
The name of the rule

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