libnick 2024.12.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
parameventargs.h
Go to the documentation of this file.
1
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 }
55 const T& getParam() const
56 {
57 return m_param;
58 }
59
60 private:
61 T m_param;
62 };
63}
64
65#endif //PARAMEVENTARGS_H
A base class for event arguments.
Definition eventargs.h:32
An event argument that contains a single parameter.
Definition parameventargs.h:37
const T & getParam() const
Gets the param stored in the event args.
Definition parameventargs.h:55
ParamEventArgs(const T &param)
Constructs a ParamEventArgs.
Definition parameventargs.h:46
Definition event.h:34