libnick 2025.7.3
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
parameventargs.h
Go to the documentation of this file.
1
22
23#ifndef PARAMEVENTARGS_H
24#define PARAMEVENTARGS_H
25
26#include <type_traits>
27#include "eventargs.h"
28
29namespace Nickvision::Events
30{
35 template<typename T>
37 {
38 static_assert(std::is_copy_constructible_v<T> == true);
39 static_assert(std::is_move_constructible_v<T> == true);
40
41 public:
46 ParamEventArgs(const T& param)
47 : m_param{ param }
48 {
49
50 }
51
55 const T& getParam() const
56 {
57 return m_param;
58 }
59
63 const T& operator->() const
64 {
65 return m_param;
66 }
67
72 {
73 return m_param;
74 }
75
79 const T& operator*() const
80 {
81 return m_param;
82 }
83
88 {
89 return m_param;
90 }
91
92 private:
93 T m_param;
94 };
95}
96
97#endif //PARAMEVENTARGS_H
EventArgs()=default
Constructs an EventArgs.
const T & operator*() const
Gets the param stored in the event args.
Definition parameventargs.h:79
const T & operator->() const
Gets the param stored in the event args.
Definition parameventargs.h:63
const T & getParam() const
Gets the param stored in the event args.
Definition parameventargs.h:55
T & operator->()
Gets the param stored in the event args.
Definition parameventargs.h:71
ParamEventArgs(const T &param)
Constructs a ParamEventArgs.
Definition parameventargs.h:46
T & operator*()
Gets the param stored in the event args.
Definition parameventargs.h:87
Definition event.h:34