RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::Platform Class Referenceabstract

What the runtime needs from the outside world: a clock, a way to wait, and the competition mode. More...

#include <Platform.hpp>

Inheritance diagram for rz::Platform:
rz::ProsPlatform rz::SimulationPlatform

Public Member Functions

virtual ~Platform ()=default
virtual Time now () const =0
 Monotonic time.
virtual void sleepUntil (Time time)=0
 Blocks until now() >= time. Returns immediately if that time has passed.
virtual CompetitionMode competitionMode () const =0
 The mode field control is in right now.

Detailed Description

What the runtime needs from the outside world: a clock, a way to wait, and the competition mode.

impl/Pros/Runtime/ProsPlatform implements this on the V5; impl/Simulation/Runtime/SimulationPlatform is a fake for host tests, where waiting simply advances time and the mode is set by the test.

Constructor & Destructor Documentation

◆ ~Platform()

virtual rz::Platform::~Platform ( )
virtualdefault

Member Function Documentation

◆ competitionMode()

virtual CompetitionMode rz::Platform::competitionMode ( ) const
nodiscardpure virtual

The mode field control is in right now.

Implemented in rz::ProsPlatform, and rz::SimulationPlatform.

◆ now()

virtual Time rz::Platform::now ( ) const
nodiscardpure virtual

Monotonic time.

Implemented in rz::ProsPlatform, and rz::SimulationPlatform.

◆ sleepUntil()

virtual void rz::Platform::sleepUntil ( Time time)
pure virtual

Blocks until now() >= time. Returns immediately if that time has passed.

Implemented in rz::ProsPlatform, and rz::SimulationPlatform.


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