|
| | AndTrigger (std::unique_ptr< Trigger< TriggerContextStruct > > A, std::unique_ptr< Trigger< TriggerContextStruct > > B) |
| | Construct AND from two triggers (ownership transferred).
|
| |
| | ~AndTrigger () override=default |
| |
| bool | check (const TriggerContextStruct &ctx) const override |
| | Evaluate A && B; increments hit/miss counters.
|
| |
| void | update (const TriggerContextStruct &ctx) override |
| | Update both sub-triggers and increment update counter.
|
| |
| void | reset () override |
| | Reset both sub-triggers and local counters.
|
| |
| std::string | name () const override |
| | Human-readable name.
|
| |
| TriggerResult | why (const TriggerContextStruct &ctx) const override |
| | Structured explanation; short-circuits on A=false.
|
| |
| std::string | describe () const override |
| | Description expression e.g. "(A) AND (B)".
|
| |
| size_t | numTriggers () const override |
| | Number of true evaluations since last reset.
|
| |
| size_t | numMisses () const override |
| | Number of false evaluations since last reset.
|
| |
| virtual | ~Trigger ()=default |
| | Virtual destructor for polymorphic use.
|
| |
template<typename TriggerContextStruct>
class gridfire::trigger::AndTrigger< TriggerContextStruct >
Logical conjunction of two triggers with short-circuit evaluation.
check(ctx) returns A.check(ctx) && B.check(ctx). The why(ctx) explanation short-circuits if A is false, avoiding evaluation of B. update(ctx) calls update() on both A and B.
Counters (mutable) are incremented inside const check(): m_hits on true; m_misses on false; m_updates on each update(); m_resets on reset().
- Example
if (t.check(ctx)) { (void)ctx; }
AndTrigger(std::unique_ptr< Trigger< TriggerContextStruct > > A, std::unique_ptr< Trigger< TriggerContextStruct > > B)
Construct AND from two triggers (ownership transferred).
Definition trigger_logical.h:196