[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:
Peter Johnson
2021-01-11 21:55:45 -08:00
committed by GitHub
parent 26584ff145
commit 9c3b51ca0f
64 changed files with 4516 additions and 199 deletions

View File

@@ -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: