SMACC
Loading...
Searching...
No Matches
eg_conditional_generator.cpp
Go to the documentation of this file.
2
3namespace smacc
4{
5 namespace event_generators
6 {
7 EgConditionalGenerator::EgConditionalGenerator(ConditionalGeneratorMode mode, std::function <bool()> updatePredicate)
8 :mode_(mode),
9 updatePredicate_(updatePredicate)
10 {
11
12 }
13
15 {
16 if(this->updatePredicate_())
17 {
18 this->postEventTrue();
19 }
20 else
21 {
22 this->postEventFalse();
23 }
24 }
25
27 {
29 {
31 }
32 }
33
35 {
37 {
39 }
40 }
41
42 void EgConditionalGenerator::setPredicateFunction(std::function <bool()> updatePredicate)
43 {
44 updatePredicate_ = updatePredicate;
45 }
46
47 } // namespace state_reactors
48} // namespace smacc
void setPredicateFunction(std::function< bool()> updatePredicate)
EgConditionalGenerator(ConditionalGeneratorMode mode, std::function< bool()> updatePredicate=nullptr)