|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <RetryTransition.h>
Inheritance diagram for RetryTransition:
Collaboration diagram for RetryTransition:Public Types | |
| using | RetryAction = std::function< void()> |
Public Member Functions | |
| template<typename Func > | |
| RetryTransition (const typename QtPrivate::FunctionPointer< Func >::Object *sender, Func signalFn, QAbstractState *target, RetryAction retryAction, int maxRetries=1) | |
| void | reset () |
| Reset retry count (call when re-entering the source state) | |
| int | retryCount () const |
| Get current retry count. | |
| int | maxRetries () const |
| Get max retries setting. | |
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 |
| void | onTransition (QEvent *event) override |
| Called when transition fires (after max retries) | |
Transition that retries an action N times before advancing to target state. Useful for timeout handling where you want to retry before giving up.
On each trigger (e.g., timeout signal):
Example usage:
Definition at line 26 of file RetryTransition.h.
| using RetryTransition::RetryAction = std::function<void()> |
Definition at line 32 of file RetryTransition.h.
|
inline |
Create a retry transition
| sender | Object emitting the trigger signal (usually the state itself) |
| signal | Signal that triggers retry/advance (usually timeout) |
| target | State to transition to after max retries exhausted |
| retryAction | Action to invoke on each retry attempt |
| maxRetries | Maximum retry attempts before transitioning (default: 1) |
Definition at line 41 of file RetryTransition.h.
|
overrideprotected |
Override to implement retry logic Returns false during retries (blocking transition), true after max retries
Definition at line 9 of file RetryTransition.cc.
|
inline |
Get max retries setting.
Definition at line 60 of file RetryTransition.h.
|
overrideprotected |
Called when transition fires (after max retries)
Definition at line 42 of file RetryTransition.cc.
|
inline |
Reset retry count (call when re-entering the source state)
Definition at line 54 of file RetryTransition.h.
|
inline |
Get current retry count.
Definition at line 57 of file RetryTransition.h.