NMEA2000 Library  0.1
Library to handle NMEA 2000 Communication written in C++
tN2kScheduler Class Reference

Un synchronized Scheduler which can roll over. More...

#include <N2kTimer.h>

Public Member Functions

 tN2kScheduler (tN2kSchedulerTime _NextTime=N2kSchedulerDisabled)
 Constructor. More...
 
void Disable ()
 Disable the Scheduler. More...
 
void FromNow (uint32_t _Add)
 Set Timestamp for next event relative to now. More...
 
bool IsDisabled () const
 Check if the scheduler is disabled. More...
 
bool IsEnabled () const
 Check if the scheduler is enabled. More...
 
bool IsTime () const
 Is it time for the next event. More...
 

Protected Member Functions

tN2kSchedulerTime Now ()
 

Protected Attributes

tN2kSchedulerTime NextTime
 Timestamp for next event. More...
 

Detailed Description

Un synchronized Scheduler which can roll over.

tN2kScheduler can be used for scheduling, which does not require synchronization and can roll over. Scheduling works properly even on 32bit millisecond timer roll over. tN2kScheduler uses fastest method depending of platform.

Definition at line 286 of file N2kTimer.h.

Constructor & Destructor Documentation

◆ tN2kScheduler()

tN2kScheduler::tN2kScheduler ( tN2kSchedulerTime  _NextTime = N2kSchedulerDisabled)
inline

Constructor.

Parameters
_NextTimeTimestamp for next event

Definition at line 301 of file N2kTimer.h.

Member Function Documentation

◆ Disable()

void tN2kScheduler::Disable ( )
inline

Disable the Scheduler.

Definition at line 306 of file N2kTimer.h.

◆ FromNow()

void tN2kScheduler::FromNow ( uint32_t  _Add)
inline

Set Timestamp for next event relative to now.

Parameters
_AddTime delay from now for next event

Definition at line 345 of file N2kTimer.h.

◆ IsDisabled()

bool tN2kScheduler::IsDisabled ( ) const
inline

Check if the scheduler is disabled.

Returns
true scheduler is disabled
false

Definition at line 316 of file N2kTimer.h.

◆ IsEnabled()

bool tN2kScheduler::IsEnabled ( ) const
inline

Check if the scheduler is enabled.

Returns
true scheduler is enabled
false

Definition at line 324 of file N2kTimer.h.

◆ IsTime()

bool tN2kScheduler::IsTime ( ) const
inline

Is it time for the next event.

Returns
true when now > nextTime
false

Definition at line 332 of file N2kTimer.h.

◆ Now()

tN2kSchedulerTime tN2kScheduler::Now ( )
protected

Definition at line 63 of file N2kTimer.cpp.

Member Data Documentation

◆ NextTime

tN2kSchedulerTime tN2kScheduler::NextTime
protected

Timestamp for next event.

Definition at line 290 of file N2kTimer.h.


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