Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
dcpp::ITimer Class Referenceabstract

Interface for getting and manipulating the virtual time. More...

#include <duckcpp/core/engine/ITimer.hpp>

Inheritance diagram for dcpp::ITimer:
Inheritance graph
Collaboration diagram for dcpp::ITimer:
Collaboration graph

Classes

class  RealTimeDate
 

Public Types

enum  EWeekday {
  EWD_SUNDAY =0 , EWD_MONDAY , EWD_TUESDAY , EWD_WEDNESDAY ,
  EWD_THURSDAY , EWD_FRIDAY , EWD_SATURDAY
}
 

Public Member Functions

virtual dcpp::uint32_kt getRealTime () const =0
 Returns current real time in milliseconds of the system.
 
virtual RealTimeDate getRealTimeAndDate () const =0
 
virtual dcpp::uint32_kt getTime () const =0
 Returns current virtual time in milliseconds.
 
virtual void setTime (dcpp::uint32_kt time)=0
 sets current virtual time
 
virtual void stop ()=0
 Stops the virtual timer.
 
virtual void start ()=0
 Starts the virtual timer.
 
virtual void setSpeed (dcpp::float32_kt speed=1.0f)=0
 Sets the speed of the timer.
 
virtual dcpp::float32_kt getSpeed () const =0
 Returns current speed of the timer.
 
virtual bool isStopped () const =0
 Returns if the virtual timer is currently stopped.
 
virtual void tick ()=0
 Advances the virtual time.
 
- Public Member Functions inherited from dcpp::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
dcpp::int32_kt getReferenceCount () const
 Get the reference count.
 
const dcpp::char_ktgetDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

- Protected Member Functions inherited from dcpp::IReferenceCounted
void setDebugName (const dcpp::char_kt *newName)
 Sets the debug name of the object.
 

Detailed Description

Interface for getting and manipulating the virtual time.

Member Function Documentation

◆ getRealTime()

virtual dcpp::uint32_kt dcpp::ITimer::getRealTime ( ) const
pure virtual

Returns current real time in milliseconds of the system.

This value does not start with 0 when the application starts. For example in one implementation the value returned could be the amount of milliseconds which have elapsed since the system was started.

◆ getSpeed()

virtual dcpp::float32_kt dcpp::ITimer::getSpeed ( ) const
pure virtual

Returns current speed of the timer.

The speed is the factor with which the time is running faster or slower then the real system time.

◆ getTime()

virtual dcpp::uint32_kt dcpp::ITimer::getTime ( ) const
pure virtual

Returns current virtual time in milliseconds.

This value starts with 0 and can be manipulated using setTime(), stopTimer(), startTimer(), etc. This value depends on the set speed of the timer if the timer is stopped, etc. If you need the system time, use getRealTime()

◆ setSpeed()

virtual void dcpp::ITimer::setSpeed ( dcpp::float32_kt  speed = 1.0f)
pure virtual

Sets the speed of the timer.

The speed is the factor with which the time is running faster or slower then the real system time.

◆ start()

virtual void dcpp::ITimer::start ( )
pure virtual

Starts the virtual timer.

The timer is reference counted, which means everything which calls stop() will also have to call start(), otherwise the timer may not start/stop correctly again.

◆ stop()

virtual void dcpp::ITimer::stop ( )
pure virtual

Stops the virtual timer.

The timer is reference counted, which means everything which calls stop() will also have to call start(), otherwise the timer may not start/stop correctly again.

◆ tick()

virtual void dcpp::ITimer::tick ( )
pure virtual

Advances the virtual time.

Makes the virtual timer update the time value based on the real time. This is called automatically when calling DuckcppDevice::run(), but you can call it manually if you don't use this method.


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

Duckcpp    @cppfx.xyz