FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
Time utility/tools

Everything related to time control. More...

Classes

class  fge::Clock
 A clock that can be used to measure time. More...
 
class  fge::Timer
 A timer that can be used with the timer manager to handle time. More...
 
FGE_API void fge::timer::Init ()
 Init the timer manager.
 
FGE_API bool fge::timer::IsInit ()
 Check if the timer manager is initialized.
 
FGE_API void fge::timer::Uninit ()
 Un-init the timer manager.
 
FGE_API void fge::timer::Notify ()
 Notify the timer manager thread generally used after adding/updating a timer.
 
FGE_API fge::timer::TimerShared fge::timer::Create (fge::timer::TimerShared timer)
 Add a new timer to be handled by the thread.
 
FGE_API bool fge::timer::Destroy (fge::timer::TimerShared const &timer)
 Destroy a timer with the given pointer.
 
FGE_API bool fge::timer::Remove (std::string const &timerName)
 Destroy a timer with the given name.
 
FGE_API void fge::timer::RemoveAll ()
 Destroy all timers.
 
FGE_API bool fge::timer::Check (fge::timer::TimerShared const &timer)
 Check if the given timer pointer exist in the manager.
 
FGE_API bool fge::timer::Check (std::string const &timerName)
 Check if the given timer name exist in the manager.
 
FGE_API std::size_t fge::timer::GetTimerSize ()
 Get the total number of timers.
 
FGE_API fge::timer::TimerShared fge::timer::Get (std::string const &timerName)
 Get the timer pointer with the given name.
 

Detailed Description

Everything related to time control.

Function Documentation

◆ Check() [1/2]

FGE_API bool fge::timer::Check ( fge::timer::TimerShared const & timer)

Check if the given timer pointer exist in the manager.

Parameters
timerThe timer to check
Returns
true if the timer exist, false otherwise

◆ Check() [2/2]

FGE_API bool fge::timer::Check ( std::string const & timerName)

Check if the given timer name exist in the manager.

Parameters
timerNameThe timer name to check
Returns
true if the timer exist, false otherwise

◆ Create()

FGE_API fge::timer::TimerShared fge::timer::Create ( fge::timer::TimerShared timer)

Add a new timer to be handled by the thread.

Parameters
timerThe timer to add
Returns
The same timer pointer

◆ Destroy()

FGE_API bool fge::timer::Destroy ( fge::timer::TimerShared const & timer)

Destroy a timer with the given pointer.

Parameters
timerThe timer to destroy
Returns
true if the timer was destroyed, false otherwise

◆ Get()

FGE_API fge::timer::TimerShared fge::timer::Get ( std::string const & timerName)

Get the timer pointer with the given name.

Parameters
timerNameThe name of the timer to get
Returns
The timer pointer with the given name or the nullptr if not found

◆ GetTimerSize()

FGE_API std::size_t fge::timer::GetTimerSize ( )

Get the total number of timers.

Returns
The total number of timers

◆ Init()

FGE_API void fge::timer::Init ( )

Init the timer manager.

This will create the timer thread.

◆ IsInit()

FGE_API bool fge::timer::IsInit ( )

Check if the timer manager is initialized.

Returns
true if the timer manager is initialized, false otherwise

◆ Notify()

FGE_API void fge::timer::Notify ( )

Notify the timer manager thread generally used after adding/updating a timer.

◆ Remove()

FGE_API bool fge::timer::Remove ( std::string const & timerName)

Destroy a timer with the given name.

Parameters
timerNameThe timer name to destroy
Returns
true if the timer was destroyed, false otherwise

◆ RemoveAll()

FGE_API void fge::timer::RemoveAll ( )

Destroy all timers.

◆ Uninit()

FGE_API void fge::timer::Uninit ( )

Un-init the timer manager.