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