WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::Notifier Class Reference
Inheritance diagram for frc::Notifier:
frc::ErrorBase

Public Member Functions

 Notifier (TimerEventHandler handler)
 Create a Notifier for timer event notification. More...
 
template<typename Callable , typename Arg , typename... Args>
 Notifier (Callable &&f, Arg &&arg, Args &&...args)
 
virtual ~Notifier ()
 Free the resources for a timer event.
 
 Notifier (Notifier &&rhs)
 
Notifieroperator= (Notifier &&rhs)
 
void SetHandler (TimerEventHandler handler)
 Change the handler function. More...
 
void StartSingle (double delay)
 Register for single event notification. More...
 
void StartPeriodic (double period)
 Register for periodic event notification. More...
 
void Stop ()
 Stop timer events from occuring. More...
 
- Public Member Functions inherited from frc::ErrorBase
 ErrorBase (ErrorBase &&)=default
 
ErrorBaseoperator= (ErrorBase &&)=default
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 Retrieve the current error. More...
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual void SetErrnoError (const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const wpi::Twine &errorMessage, Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::ErrorBase
static void SetGlobalError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (const wpi::Twine &errorMessage, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber)
 
static const ErrorGetGlobalError ()
 Retrieve the current global error.
 
- Protected Attributes inherited from frc::ErrorBase
Error m_error
 

Constructor & Destructor Documentation

frc::Notifier::Notifier ( TimerEventHandler  handler)
explicit

Create a Notifier for timer event notification.

Parameters
handlerThe handler is called at the notification time which is set using StartSingle or StartPeriodic.

Member Function Documentation

void frc::Notifier::SetHandler ( TimerEventHandler  handler)

Change the handler function.

Parameters
handlerHandler
void frc::Notifier::StartPeriodic ( double  period)

Register for periodic event notification.

A timer event is queued for periodic event notification. Each time the interrupt occurs, the event will be immediately requeued for the same time interval.

Parameters
periodPeriod in seconds to call the handler starting one period after the call to this method.
void frc::Notifier::StartSingle ( double  delay)

Register for single event notification.

A timer event is queued for a single event after the specified delay.

Parameters
delaySeconds to wait before the handler is called.
void frc::Notifier::Stop ( )

Stop timer events from occuring.

Stop any repeating timer events from occuring. This will also remove any single notification events from the queue.

If a timer-based call to the registered handler is in progress, this function will block until the handler call is complete.


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