Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
aurore::Ticking Class Referenceabstract

#include <aurore/core/time.hpp>

Inheritance diagram for aurore::Ticking:
aurore::FiniteTicking aurore::RepeatingTimer aurore::Animatable aurore::Timer aurore::RepeatingTask

Public Member Functions

virtual ~Ticking ()
 
void start ()
 
void stop ()
 
void setEndCallback (TickingEndCallback endCallback)
 
void setTickCallback (TickingTickCallback tickCallback)
 
bool isRunning ()
 

Static Public Member Functions

static void updateTickings ()
 

Static Public Attributes

static std::vector< Ticking * > runningTickings
 

Protected Member Functions

virtual bool onUpdate (Time delta)=0
 
virtual void onStart ()
 
virtual void onStop ()
 

Constructor & Destructor Documentation

◆ ~Ticking()

virtual aurore::Ticking::~Ticking ( )
virtual

Member Function Documentation

◆ isRunning()

bool aurore::Ticking::isRunning ( )

Returns true if the ticking is currently running.

◆ onStart()

virtual void aurore::Ticking::onStart ( )
inlineprotectedvirtual

Called when the ticking becomes active.

Reimplemented in aurore::Timer, and aurore::RepeatingTimer.

◆ onStop()

virtual void aurore::Ticking::onStop ( )
inlineprotectedvirtual

Called when the ticking is stopped, either by the user or because it finished.

◆ onUpdate()

virtual bool aurore::Ticking::onUpdate ( Time  delta)
protectedpure virtual

Executed every frame while the ticking lives. Delta is the time difference in ms between the last frame and the current one. Must return false if the ticking is finished and should be removed from the list of active tickings. The end callback will automatically be called then.

Implemented in aurore::Animatable, aurore::Timer, and aurore::RepeatingTimer.

◆ setEndCallback()

void aurore::Ticking::setEndCallback ( TickingEndCallback  endCallback)

Sets a callback to be executed when the ticking finishes. The callback argument will be set to true if the ticking stopped on its own, false if it was stopped early by the user.

◆ setTickCallback()

void aurore::Ticking::setTickCallback ( TickingTickCallback  tickCallback)

Sets a callback to be executed at every tick until the ticking finishes.

The last animation tick will execute the tick callback then the end callback.

◆ start()

void aurore::Ticking::start ( )

Starts the ticking, pushing it to the list of running tickings. If the ticking is finished, it will be restarted. If the ticking is already running, this method will have no effect.

◆ stop()

void aurore::Ticking::stop ( )

Stops the ticking if it was running, and executes the end callback.

◆ updateTickings()

static void aurore::Ticking::updateTickings ( )
static

Called internally by the main loop. Takes all running tickings and updates them.

Member Data Documentation

◆ runningTickings

std::vector<Ticking*> aurore::Ticking::runningTickings
inlinestatic

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