|
QGroundControl
Ground Control Station for MAVLink Drones
|
A transition that only fires if a guard predicate returns true. More...
#include <GuardedTransition.h>
Inheritance diagram for GuardedTransition:
Collaboration diagram for GuardedTransition:Public Types | |
| using | Guard = std::function< bool()> |
Public Member Functions | |
| template<typename Func > | |
| GuardedTransition (const typename QtPrivate::FunctionPointer< Func >::Object *sender, Func signalFn, QAbstractState *target, Guard guard) | |
| template<typename Func > | |
| GuardedTransition (const typename QtPrivate::FunctionPointer< Func >::Object *sender, Func signalFn, Guard guard) | |
| void | setGuard (Guard guard) |
| Set the guard predicate. | |
| Guard | guard () const |
| Get the current guard predicate. | |
Public Member Functions inherited from QGCSignalTransition | |
| QGCSignalTransition (QState *sourceState=nullptr) | |
| QGCSignalTransition (const QObject *sender, const char *signal, QState *sourceState=nullptr) | |
| template<typename Func > | |
| QGCSignalTransition (const typename QtPrivate::FunctionPointer< Func >::Object *sender, Func signalFn, QState *sourceState=nullptr) | |
| QGCStateMachine * | machine () const |
| Get the QGCStateMachine this transition belongs to. | |
| Vehicle * | vehicle () const |
| Get the Vehicle associated with the state machine. | |
Protected Member Functions | |
| bool | eventTest (QEvent *event) override |
| Override to check guard before allowing transition. | |
A transition that only fires if a guard predicate returns true.
Useful for conditional transitions based on runtime state
Definition at line 11 of file GuardedTransition.h.
| using GuardedTransition::Guard = std::function<bool()> |
Definition at line 17 of file GuardedTransition.h.
|
inline |
Create a guarded transition
| sender | Object that emits the signal |
| signal | Signal that triggers the transition |
| target | Target state |
| guard | Predicate that must return true for transition to fire |
Definition at line 25 of file GuardedTransition.h.
|
inline |
Create a guarded transition without target (set later)
| sender | Object that emits the signal |
| signal | Signal that triggers the transition |
| guard | Predicate that must return true for transition to fire |
Definition at line 40 of file GuardedTransition.h.
|
overrideprotected |
Override to check guard before allowing transition.
Definition at line 4 of file GuardedTransition.cc.
|
inline |
Get the current guard predicate.
Definition at line 52 of file GuardedTransition.h.
Referenced by setGuard().
|
inline |