GridFire v0.7.1_rc2 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
gridfire::trigger::OrTrigger< TriggerContextStruct > Class Template Referencefinal

Logical disjunction of two triggers with short-circuit evaluation. More...

`#include <trigger_logical.h>`

Inheritance diagram for gridfire::trigger::OrTrigger< TriggerContextStruct >:
[legend]
Collaboration diagram for gridfire::trigger::OrTrigger< TriggerContextStruct >:
[legend]

## Public Member Functions
| OrTrigger (std::unique_ptr< Trigger< TriggerContextStruct > > A, std::unique_ptr< Trigger< TriggerContextStruct > > B)
| ~OrTrigger () override=default
bool | check (const TriggerContextStruct &ctx) const override
| Evaluate the trigger condition against the provided context.
void | update (const TriggerContextStruct &ctx) override
| Update any internal state with the given context (e.g., counters, windows).
void | step (const TriggerContextStruct &ctx) override
| similar to update but intended to be run on every step not just those where the trigger triggered
void | reset () override
| Reset internal state and diagnostics counters.
std::string | name () const override
| Short, stable name for this trigger (suitable for logs/UI).
TriggerResult | why (const TriggerContextStruct &ctx) const override
| Explain why the last evaluation would be true/false in a structured way.
std::string | describe () const override
| Human-readable description of this trigger's logic.
size_t | numTriggers () const override
| Total number of times this trigger evaluated to true since last reset.
size_t | numMisses () const override
| Total number of times this trigger evaluated to false since last reset.
Public Member Functions inherited from gridfire::trigger::Trigger< TriggerContextStruct >
virtual | ~Trigger ()=default
| Virtual destructor for polymorphic use.

## Private Attributes
std::unique_ptr< Trigger< TriggerContextStruct > > | m_A
std::unique_ptr< Trigger< TriggerContextStruct > > | m_B
size_t | m_hits = 0
size_t | m_misses = 0
size_t | m_updates = 0
size_t | m_resets = 0
size_t | m_steps = 0

## Detailed Description

template<typename TriggerContextStruct>
class gridfire::trigger::OrTrigger< TriggerContextStruct >

Logical disjunction of two triggers with short-circuit evaluation.

check(ctx) returns A.check(ctx) || B.check(ctx). why(ctx) returns early when A is true. update(ctx) calls update() on both A and B. Counters behave as in AndTrigger.

## Constructor & Destructor Documentation

## ◆ OrTrigger()

template<typename TriggerContextStruct >

gridfire::trigger::OrTrigger< TriggerContextStruct >::OrTrigger | ( | std::unique_ptr< Trigger< TriggerContextStruct > > | A,
|  | std::unique_ptr< Trigger< TriggerContextStruct > > | B
| ) |  |

## ◆ ~OrTrigger()

template<typename TriggerContextStruct >

gridfire::trigger::OrTrigger< TriggerContextStruct >::~OrTrigger | ( |  | ) |
| override default

## Member Function Documentation

## ◆ check()

template<typename TriggerContextStruct >

bool gridfire::trigger::OrTrigger< TriggerContextStruct >::check | ( | const TriggerContextStruct & | ctx | ) | const
| override virtual

Evaluate the trigger condition against the provided context.

Parameters

  ctx | Context snapshot (immutable view) used to evaluate the condition.

Returns
  true if the condition is satisfied; false otherwise.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ describe()

template<typename TriggerContextStruct >

std::string gridfire::trigger::OrTrigger< TriggerContextStruct >::describe | ( |  | ) | const
| override virtual

Human-readable description of this trigger's logic.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ name()

template<typename TriggerContextStruct >

std::string gridfire::trigger::OrTrigger< TriggerContextStruct >::name | ( |  | ) | const
| override virtual

Short, stable name for this trigger (suitable for logs/UI).

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ numMisses()

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::numMisses | ( |  | ) | const
| override virtual

Total number of times this trigger evaluated to false since last reset.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ numTriggers()

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::numTriggers | ( |  | ) | const
| override virtual

Total number of times this trigger evaluated to true since last reset.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ reset()

template<typename TriggerContextStruct >

void gridfire::trigger::OrTrigger< TriggerContextStruct >::reset | ( |  | ) |
| override virtual

Reset internal state and diagnostics counters.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ step()

template<typename TriggerContextStruct >

void gridfire::trigger::OrTrigger< TriggerContextStruct >::step | ( | const TriggerContextStruct & | ctx | ) |
| override virtual

similar to update but intended to be run on every step not just those where the trigger triggered

Parameters

  ctx | Context snapshot used to update state.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ update()

template<typename TriggerContextStruct >

void gridfire::trigger::OrTrigger< TriggerContextStruct >::update | ( | const TriggerContextStruct & | ctx | ) |
| override virtual

Update any internal state with the given context (e.g., counters, windows).

Parameters

  ctx | Context snapshot used to update state.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## ◆ why()

template<typename TriggerContextStruct >

TriggerResult gridfire::trigger::OrTrigger< TriggerContextStruct >::why | ( | const TriggerContextStruct & | ctx | ) | const
| override virtual

Explain why the last evaluation would be true/false in a structured way.

Parameters

  ctx | Context snapshot for the explanation.

Returns
  A TriggerResult tree with a boolean value and per-cause details.

Implements gridfire::trigger::Trigger< TriggerContextStruct >.

## Member Data Documentation

## ◆ m_A

template<typename TriggerContextStruct >

std::unique_ptr<Trigger<TriggerContextStruct> > gridfire::trigger::OrTrigger< TriggerContextStruct >::m_A
| private

## ◆ m_B

template<typename TriggerContextStruct >

std::unique_ptr<Trigger<TriggerContextStruct> > gridfire::trigger::OrTrigger< TriggerContextStruct >::m_B
| private

## ◆ m_hits

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::m_hits = 0
| mutable private

## ◆ m_misses

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::m_misses = 0
| mutable private

## ◆ m_resets

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::m_resets = 0
| mutable private

## ◆ m_steps

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::m_steps = 0
| mutable private

## ◆ m_updates

template<typename TriggerContextStruct >

size_t gridfire::trigger::OrTrigger< TriggerContextStruct >::m_updates = 0
| mutable private

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

- src/include/gridfire/trigger/trigger_logical.h