mFrame
載入中...
搜尋中...
無符合項目
FunctionEvent.h
1
7#ifndef MFRAME_F730676C_6AFB_43FF_A269_0F8D00511C5D
8#define MFRAME_F730676C_6AFB_43FF_A269_0F8D00511C5D
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../func/Function.h"
18#include "./../lang/Object.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mframe::func {
24 class FunctionEvent;
25} // namespace mframe::func
26
27/* ***************************************************************************************
28 * Class/struct/Struct
29 */
31 public mframe::func::Function<> {
32 /* *************************************************************************************
33 * Variable
34 */
35 private:
36 Interface& (*vFunction)(Interface&);
37
38 /* *************************************************************************************
39 * Abstract Method
40 */
41
42 /* *************************************************************************************
43 * Construct Method
44 */
45 public:
51 template <typename T, typename R>
52 FunctionEvent(R& (*function)(T&)) {
53 this->vFunction = reinterpret_cast<Interface& (*)(Interface&)>(function);
54 return;
55 }
56
61 virtual ~FunctionEvent(void) override;
62
63 /* *************************************************************************************
64 * Operator Method
65 */
66 public:
74 template <typename T, typename R>
75 inline operator const Function<T, R>&(void) const {
76 const Function<>* src = this;
77 return *reinterpret_cast<const Function<T, R>*>(src);
78 }
79
86 template <typename T, typename R>
87 inline operator Function<T, R>&(void) {
88 Function<>* src = this;
89 return *reinterpret_cast<Function<T, R>*>(src);
90 }
91
92 /* *************************************************************************************
93 * Public Method <Override> - mframe::func::Function<Interface, Interface>
94 */
95 public:
96 virtual Interface& apply(Interface& t) override;
97
98 /* *************************************************************************************
99 * Public Method
100 */
101
102 /* *************************************************************************************
103 * Protected Method
104 */
105
106 /* *************************************************************************************
107 * Private Method
108 */
109
110 /* *************************************************************************************
111 * Static Variable
112 */
113
114 /* *************************************************************************************
115 * Static Method
116 */
117};
118
119/* ***************************************************************************************
120 * End of file
121 */
122
123#endif /* MFRAME_F730676C_6AFB_43FF_A269_0F8D00511C5D */
Definition FunctionEvent.h:31
virtual ~FunctionEvent(void) override
Destroy the Function Event object.
FunctionEvent(R &(*function)(T &))
Construct a new Function Event object.
Definition FunctionEvent.h:52
Definition Object.h:34
Definition BiConsumer.h:22
Definition Function.h:31
Definition Interface.h:134