xtd 0.2.0
animation_update_event_args.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/event_args>
6 #include <xtd/time_span>
7 
9 namespace xtd {
11  namespace forms {
21  public:
23 
25  animation_updated_event_args(int32 frame_counter, std::chrono::nanoseconds elapsed) : frame_counter_(frame_counter), elapsed_(elapsed) {}
27 
29 
33  time_span elapsed() const {return time_span {std::chrono::duration_cast<xtd::ticks>(elapsed_).count()};}
36  int64 elapsed_milliseconds() const {return std::chrono::duration_cast<std::chrono::milliseconds>(elapsed_).count();}
39  int64 elapsed_nanoseconds() const {return elapsed_.count();}
40 
43  int32 frame_counter() const {return frame_counter_;}
45 
46  private:
47  int32 frame_counter_ = 0;
48  std::chrono::nanoseconds elapsed_ {0};
49  };
50  }
51 }
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
std::chrono::duration< int64, tick > ticks
Represents a tick duration.
Definition: ticks.h:21
int64 elapsed_milliseconds() const
Gets elepased time in milliseconds.
Definition: animation_update_event_args.h:36
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
int64 elapsed_nanoseconds() const
Gets elepased time in nanoseconds.
Definition: animation_update_event_args.h:39
Provides data for the animation update event.
Definition: animation_update_event_args.h:20
Represents a time interval.
Definition: time_span.h:26
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
int32 frame_counter() const
Gets frame counter.
Definition: animation_update_event_args.h:43
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:140
time_span elapsed() const
Gets elepased time in nanoseconds.
Definition: animation_update_event_args.h:33