|
Hegel 0.18.3
Property-based testing for C++
|
An action that a worker can apply to a concurrent state machine. More...
#include <stateful.h>
Public Types | |
| using | Step = std::function<void(TestCase&, M&)> |
| The function the rule applies. | |
Public Member Functions | |
| ConcurrentRule (std::string name, Step step) | |
| Creates a rule in anonymous_group. | |
| ConcurrentRule (std::string name, std::vector< std::string > groups, Step step) | |
| Creates a rule in the specified groups. | |
| ConcurrentRule (std::string name, std::vector< std::string > groups, double weight, Step step) | |
| Creates a rule in the specified groups with a weight. | |
| ConcurrentRule (ConcurrentRuleParams< M > params) | |
| Creates a rule from named arguments. | |
| const std::string & | name () const |
| Returns the name of the rule. | |
| const std::vector< std::string > & | groups () const |
| Returns the concurrency groups of the rule. | |
| double | weight () const |
| Returns the weight of the rule. | |
| const Step & | step () const |
| Returns the function the rule applies. | |
An action that a worker can apply to a concurrent state machine.
A rule belongs to one or more concurrency groups. Rules that share a group can run concurrently in the rounds of that group. Rules that share no group never overlap. A rule that belongs to several groups runs in the rounds of each of them. A rule that does not specify a group uses anonymous_group.
The engine rejects a rule with an empty group list or a repeated group when the machine starts, with std::invalid_argument.
| M | The state-machine type that the rule acts on |
|
inline |
Creates a rule in anonymous_group.
| name | The name of the rule |
| step | The function the rule applies. |
|
inline |
Creates a rule in the specified groups.
| name | The name of the rule |
| groups | The concurrency groups of the rule |
| step | The function the rule applies |
|
inline |
Creates a rule in the specified groups with a weight.
| name | The name of the rule |
| groups | The concurrency groups of the rule |
| weight | The selection weight of the rule |
| step | The function the rule applies |
|
inlineexplicit |
Creates a rule from named arguments.
| params | The name, groups, weight and step of the rule |
|
inline |
Returns the concurrency groups of the rule.
|
inline |
Returns the name of the rule.
|
inline |
Returns the function the rule applies.
|
inline |
Returns the weight of the rule.