mFrame
載入中...
搜尋中...
無符合項目
BiConsumerEvent.h
1
7#ifndef MFRAME_CD612142_B47C_4196_98D0_5562F4AF953E
8#define MFRAME_CD612142_B47C_4196_98D0_5562F4AF953E
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../func/BiConsumer.h"
18#include "./../lang/Object.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace ufm::func {
24 class BiConsumerEvent;
25} // namespace ufm::func
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
30
39 /* *************************************************************************************
40 * Variable
41 */
42 private:
46 void (*vFunction)(Interface&, Interface&);
47
48 /* *************************************************************************************
49 * Abstract Method
50 */
51
52 /* *************************************************************************************
53 * Construct Method
54 */
55 public:
67 template <typename T, typename U>
68 BiConsumerEvent(void (*function)(T&, U&)) {
69 this->vFunction = reinterpret_cast<void (*)(Interface&, Interface&)>(function);
70 return;
71 }
72
76 virtual ~BiConsumerEvent(void) override;
77
78 /* *************************************************************************************
79 * Operator Method
80 */
81 public:
93 template <typename T, typename U>
94 inline operator const BiConsumer<T, U>&(void) const {
95 const BiConsumer<>* src = this;
96 return *reinterpret_cast<const BiConsumer<T, U>*>(src);
97 }
98
110 template <typename T, typename U>
111 inline operator BiConsumer<T, U>&(void) {
112 BiConsumer<>* src = this;
113 return *reinterpret_cast<BiConsumer<T, U>*>(src);
114 }
115
116 /* *************************************************************************************
117 * Override Method - ufm::func::BiConsumer<>
118 */
119 public:
130 virtual void accept(Interface& t, Interface& u) override;
131
132 /* *************************************************************************************
133 * Public Method
134 */
135
136 /* *************************************************************************************
137 * Protected Method
138 */
139
140 /* *************************************************************************************
141 * Private Method
142 */
143
144 /* *************************************************************************************
145 * Static Variable
146 */
147
148 /* *************************************************************************************
149 * Static Method
150 */
151};
152
153/* ***************************************************************************************
154 * End of file
155 */
156
157#endif /* MFRAME_CD612142_B47C_4196_98D0_5562F4AF953E */
雙參數消費者事件類別
Definition BiConsumerEvent.h:38
BiConsumerEvent(void(*function)(T &, U &))
建構一個新的BiConsumerEvent物件
Definition BiConsumerEvent.h:68
virtual ~BiConsumerEvent(void) override
解構子
virtual void accept(Interface &t, Interface &u) override
實現BiConsumer介面的accept方法
物件基底類別
Definition Object.h:63
Definition BiConsumer.h:22
[Interface] 雙參數消費者函數式介面模板
Definition BiConsumer.h:44
類別共用基礎介面
Definition Interface.h:152