mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Document simulation APIs (#3079)
- Remove sim checkstyle suppression - Add [[nodiscard]] to C++ register callback functions - Add a couple of missing sim functions Co-authored-by: Peter Johnson <johnson.peter@gmail.com> Co-authored-by: Starlight220 <yotamshlomi@gmail.com>
This commit is contained in:
@@ -45,27 +45,86 @@ class AnalogTriggerSim {
|
||||
*/
|
||||
static AnalogTriggerSim CreateForIndex(int index);
|
||||
|
||||
std::unique_ptr<CallbackStore> RegisterInitializedCallback(
|
||||
/**
|
||||
* Register a callback on whether the analog trigger is initialized.
|
||||
*
|
||||
* @param callback the callback that will be called whenever the analog
|
||||
* trigger is initialized
|
||||
* @param initialNotify if true, the callback will be run on the initial value
|
||||
* @return the CallbackStore object associated with this callback
|
||||
*/
|
||||
[[nodiscard]] std::unique_ptr<CallbackStore> RegisterInitializedCallback(
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Check if this analog trigger has been initialized.
|
||||
*
|
||||
* @return true if initialized
|
||||
*/
|
||||
bool GetInitialized() const;
|
||||
|
||||
/**
|
||||
* Change whether this analog trigger has been initialized.
|
||||
*
|
||||
* @param initialized the new value
|
||||
*/
|
||||
void SetInitialized(bool initialized);
|
||||
|
||||
std::unique_ptr<CallbackStore> RegisterTriggerLowerBoundCallback(
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
/**
|
||||
* Register a callback on the lower bound.
|
||||
*
|
||||
* @param callback the callback that will be called whenever the lower bound
|
||||
* is changed
|
||||
* @param initialNotify if true, the callback will be run on the initial value
|
||||
* @return the CallbackStore object associated with this callback
|
||||
*/
|
||||
[[nodiscard]] std::unique_ptr<CallbackStore>
|
||||
RegisterTriggerLowerBoundCallback(NotifyCallback callback,
|
||||
bool initialNotify);
|
||||
|
||||
/**
|
||||
* Get the lower bound.
|
||||
*
|
||||
* @return the lower bound
|
||||
*/
|
||||
double GetTriggerLowerBound() const;
|
||||
|
||||
/**
|
||||
* Change the lower bound.
|
||||
*
|
||||
* @param triggerLowerBound the new lower bound
|
||||
*/
|
||||
void SetTriggerLowerBound(double triggerLowerBound);
|
||||
|
||||
std::unique_ptr<CallbackStore> RegisterTriggerUpperBoundCallback(
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
/**
|
||||
* Register a callback on the upper bound.
|
||||
*
|
||||
* @param callback the callback that will be called whenever the upper bound
|
||||
* is changed
|
||||
* @param initialNotify if true, the callback will be run on the initial value
|
||||
* @return the CallbackStore object associated with this callback
|
||||
*/
|
||||
[[nodiscard]] std::unique_ptr<CallbackStore>
|
||||
RegisterTriggerUpperBoundCallback(NotifyCallback callback,
|
||||
bool initialNotify);
|
||||
|
||||
/**
|
||||
* Get the upper bound.
|
||||
*
|
||||
* @return the upper bound
|
||||
*/
|
||||
double GetTriggerUpperBound() const;
|
||||
|
||||
/**
|
||||
* Change the upper bound.
|
||||
*
|
||||
* @param triggerUpperBound the new upper bound
|
||||
*/
|
||||
void SetTriggerUpperBound(double triggerUpperBound);
|
||||
|
||||
/**
|
||||
* Reset all simulation data for this object.
|
||||
*/
|
||||
void ResetData();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user