Sly Engine
TimeManager Class Reference

#include <TimeManager.h>

Collaboration diagram for TimeManager:
Collaboration graph

Static Public Member Functions

static void Terminate ()
 Terminates the singleton. More...
 
static float GetFrameTime ()
 Gets frame time. More...
 
static float GetTime ()
 Gets the time. More...
 
static void ProcessTime (float sys_time)
 Process the time described by sys_time. More...
 
static float GetStartTime ()
 
static int GetFrameCount ()
 

Private Member Functions

 TimeManager ()=default
 Default constructor. More...
 
 TimeManager (const TimeManager &)=delete
 Copy constructor. More...
 
 TimeManager (TimeManager &&)=delete
 Move constructor. More...
 
TimeManageroperator= (const TimeManager &)=delete
 Assignment operator. More...
 
TimeManageroperator= (TimeManager &&)=delete
 Move assignment operator. More...
 
 ~TimeManager ()=default
 Deconstructor. More...
 
void privTerminate ()
 Private terminate. Deletes Pointer instance. More...
 
float privGetFrameTime ()
 Private get frame time. More...
 
float privGetTime ()
 Private get time. More...
 
void privProcessTime (float sys_time)
 Private process time. Take currentTime - previousTime. More...
 
float privGetStartTime ()
 
int privGetFrameCount ()
 
void privSetStartTime (float newStartTime)
 

Static Private Member Functions

static TimeManagerInstance ()
 Gets the instance. More...
 
static void SetStartTime (float newStartTime)
 

Private Attributes

float currentTime
 Current time of the system given by the engine. More...
 
float frameTime
 Frame time of the engine, result of currentTime - previousTime. More...
 
float previousTime
 Time marker used by FreezeTime. More...
 
FreezeTime FrzTime
 FreezeTime module, used for FreezeTime::GetTimeInSeconds() More...
 
float startTime
 
int frameCount
 

Static Private Attributes

static TimeManagerptrInstance = nullptr
 Singleton reference. More...
 

Friends

class TimeManagerAttorney
 Dictates access for Engine calls. More...
 

Constructor & Destructor Documentation

◆ TimeManager() [1/3]

TimeManager::TimeManager ( )
privatedefault

Default constructor.

Here is the caller graph for this function:

◆ TimeManager() [2/3]

TimeManager::TimeManager ( const TimeManager )
privatedelete

Copy constructor.

◆ TimeManager() [3/3]

TimeManager::TimeManager ( TimeManager &&  )
privatedelete

Move constructor.

◆ ~TimeManager()

TimeManager::~TimeManager ( )
privatedefault

Deconstructor.

Member Function Documentation

◆ GetFrameCount()

static int TimeManager::GetFrameCount ( )
inlinestatic
Here is the call graph for this function:

◆ GetFrameTime()

static float TimeManager::GetFrameTime ( )
inlinestatic

Gets frame time.

Returns
The frame time. Calculated as a result of the current time minus a time marker dictated by FreezeTime.
Here is the call graph for this function:

◆ GetStartTime()

static float TimeManager::GetStartTime ( )
inlinestatic
Here is the call graph for this function:

◆ GetTime()

static float TimeManager::GetTime ( )
inlinestatic

Gets the time.

Returns
Returns the time as provided by the Sly Engine through privProcessTime.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Instance()

static TimeManager & TimeManager::Instance ( )
inlinestaticprivate

Gets the instance.

Returns
A reference to a TimeManager.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

TimeManager& TimeManager::operator= ( const TimeManager )
privatedelete

Assignment operator.

◆ operator=() [2/2]

TimeManager& TimeManager::operator= ( TimeManager &&  )
privatedelete

Move assignment operator.

◆ privGetFrameCount()

int TimeManager::privGetFrameCount ( )
private
Here is the caller graph for this function:

◆ privGetFrameTime()

float TimeManager::privGetFrameTime ( )
private

Private get frame time.

Returns
A float frameTime.
Here is the caller graph for this function:

◆ privGetStartTime()

float TimeManager::privGetStartTime ( )
private
Here is the caller graph for this function:

◆ privGetTime()

float TimeManager::privGetTime ( )
private

Private get time.

Returns
A float for system time (currentTime).
Here is the caller graph for this function:

◆ privProcessTime()

void TimeManager::privProcessTime ( float  sys_time)
private

Private process time. Take currentTime - previousTime.

Parameters
sys_timeThe system time.
Here is the caller graph for this function:

◆ privSetStartTime()

void TimeManager::privSetStartTime ( float  newStartTime)
private
Here is the caller graph for this function:

◆ privTerminate()

void TimeManager::privTerminate ( )
private

Private terminate. Deletes Pointer instance.

Here is the caller graph for this function:

◆ ProcessTime()

static void TimeManager::ProcessTime ( float  sys_time)
inlinestatic

Process the time described by sys_time.

Parameters
sys_timeThe system time.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStartTime()

static void TimeManager::SetStartTime ( float  newStartTime)
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Terminate()

static void TimeManager::Terminate ( )
inlinestatic

Terminates the singleton.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ TimeManagerAttorney

friend class TimeManagerAttorney
friend

Dictates access for Engine calls.

Member Data Documentation

◆ currentTime

float TimeManager::currentTime
private

Current time of the system given by the engine.

◆ frameCount

int TimeManager::frameCount
private

◆ frameTime

float TimeManager::frameTime
private

Frame time of the engine, result of currentTime - previousTime.

◆ FrzTime

FreezeTime TimeManager::FrzTime
private

FreezeTime module, used for FreezeTime::GetTimeInSeconds()

◆ previousTime

float TimeManager::previousTime
private

Time marker used by FreezeTime.

◆ ptrInstance

TimeManager * TimeManager::ptrInstance = nullptr
staticprivate

Singleton reference.

◆ startTime

float TimeManager::startTime
private

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