iv::TimeSystem Class Reference

#include <TimeSystem.hpp>

Classes

struct  UpdateItem
 

Public Types

using timeout_iterator = std::multimap< int, UpdateItem >::iterator
 

Public Member Functions

 TimeSystem (SystemContainer *sc)
 
virtual std::string debug_name () const override
 
virtual bool flushSystem () override
 
void addTime (int delta_ms)
 
void nextFrame ()
 
int get_time_ms (TimeId time_type)
 
int get_time_to_next_frame_ms (TimeId time_type)
 
void register_frame_update_client (FrameUpdateClient *client)
 
void unregister_frame_update_client (FrameUpdateClient *client)
 
void register_fixed_update_client (FixedUpdateClient *client, TimeId time_type)
 
void unregister_fixed_update_client (FixedUpdateClient *client, TimeId time_type)
 
void speed (TimeId time_type, double speed)
 
double speed (TimeId time_type)
 
void game_update_period (TimeId time_type, int period_ms)
 
int game_update_period (TimeId time_type)
 
timeout_iterator timeout (Watch *watch, TimeId time_type, int time_abs_ms, std::function< void() > const &fun)
 
void cancel_timeout (TimeId time_type, timeout_iterator it)
 this can be called only if given iterator was returned from TimeSystem::timeout method and the timeout callback was not called yet; This functionality should be wrapped in a client class (eg. class Watch) to guarantee this behavior More...
 
void delay (Watch *watch, std::function< void() > const &fun)
 
bool is_valid (TimeId time_type)
 
- Public Member Functions inherited from iv::System
 System (SystemContainer *sc)
 
virtual ~System ()
 
virtual void status (TextDebugView *view)
 
SystemContainersystem_container () const
 
void retain ()
 
void release ()
 
- Public Member Functions inherited from iv::Context
 Context ()
 
virtual ~Context ()
 
template<class ... Items>
void log (SrcInfo const &info, LogId id, Items const &... items) const
 
bool log_enabled (LogId id) const
 
template<class ... Items>
void warning (SrcInfo const &info, Items const &... items) const
 

Additional Inherited Members

- Protected Member Functions inherited from iv::System
virtual bool log_process_enabled (LogId id) const override final
 
virtual void log_process (SrcInfo const &info, LogId id, std::string const &message) const override final
 

Detailed Description

Definition at line 20 of file TimeSystem.hpp.

Member Typedef Documentation

◆ timeout_iterator

using iv::TimeSystem::timeout_iterator = std::multimap< int, UpdateItem >::iterator

Definition at line 31 of file TimeSystem.hpp.

Constructor & Destructor Documentation

◆ TimeSystem()

iv::TimeSystem::TimeSystem ( SystemContainer sc)

Definition at line 10 of file TimeSystem.cpp.

Member Function Documentation

◆ debug_name()

virtual std::string iv::TimeSystem::debug_name ( ) const
inlineoverridevirtual

Reimplemented from iv::System.

Definition at line 37 of file TimeSystem.hpp.

◆ flushSystem()

bool iv::TimeSystem::flushSystem ( )
overridevirtual

Reimplemented from iv::System.

Definition at line 131 of file TimeSystem.cpp.

◆ addTime()

void iv::TimeSystem::addTime ( int  delta_ms)

Definition at line 23 of file TimeSystem.cpp.

◆ nextFrame()

void iv::TimeSystem::nextFrame ( )

Definition at line 28 of file TimeSystem.cpp.

◆ get_time_ms()

int iv::TimeSystem::get_time_ms ( TimeId  time_type)

Definition at line 59 of file TimeSystem.cpp.

◆ get_time_to_next_frame_ms()

int iv::TimeSystem::get_time_to_next_frame_ms ( TimeId  time_type)

Definition at line 65 of file TimeSystem.cpp.

◆ register_frame_update_client()

void iv::TimeSystem::register_frame_update_client ( FrameUpdateClient client)

Definition at line 46 of file TimeSystem.cpp.

◆ unregister_frame_update_client()

void iv::TimeSystem::unregister_frame_update_client ( FrameUpdateClient client)

Definition at line 51 of file TimeSystem.cpp.

◆ register_fixed_update_client()

void iv::TimeSystem::register_fixed_update_client ( FixedUpdateClient client,
TimeId  time_type 
)

Definition at line 116 of file TimeSystem.cpp.

◆ unregister_fixed_update_client()

void iv::TimeSystem::unregister_fixed_update_client ( FixedUpdateClient client,
TimeId  time_type 
)

Definition at line 121 of file TimeSystem.cpp.

◆ speed() [1/2]

void iv::TimeSystem::speed ( TimeId  time_type,
double  speed 
)

Definition at line 71 of file TimeSystem.cpp.

◆ speed() [2/2]

double iv::TimeSystem::speed ( TimeId  time_type)

Definition at line 77 of file TimeSystem.cpp.

◆ game_update_period() [1/2]

void iv::TimeSystem::game_update_period ( TimeId  time_type,
int  period_ms 
)

Definition at line 84 of file TimeSystem.cpp.

◆ game_update_period() [2/2]

int iv::TimeSystem::game_update_period ( TimeId  time_type)

Definition at line 90 of file TimeSystem.cpp.

◆ timeout()

TimeSystem::timeout_iterator iv::TimeSystem::timeout ( Watch watch,
TimeId  time_type,
int  time_abs_ms,
std::function< void() > const &  fun 
)

Definition at line 101 of file TimeSystem.cpp.

◆ cancel_timeout()

void iv::TimeSystem::cancel_timeout ( TimeId  time_type,
timeout_iterator  it 
)

this can be called only if given iterator was returned from TimeSystem::timeout method and the timeout callback was not called yet; This functionality should be wrapped in a client class (eg. class Watch) to guarantee this behavior

Definition at line 106 of file TimeSystem.cpp.

◆ delay()

void iv::TimeSystem::delay ( Watch watch,
std::function< void() > const &  fun 
)

Definition at line 111 of file TimeSystem.cpp.

◆ is_valid()

bool iv::TimeSystem::is_valid ( TimeId  time_type)

Definition at line 96 of file TimeSystem.cpp.


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