mFrame
載入中...
搜尋中...
無符合項目
BiConsumerMethod.h
1
7#ifndef MFRAME_18F94E68_41A6_40F6_A880_DC5C066EEDFC
8#define MFRAME_18F94E68_41A6_40F6_A880_DC5C066EEDFC
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 mframe::func {
24 class BiConsumerMethod;
25}
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
32 /* *************************************************************************************
33 * Variable
34 */
35 private:
36 Interface& vClass;
37 void (Interface::*vMethod)(Interface&, Interface&);
38
39 /* *************************************************************************************
40 * Abstract Method
41 */
42
43 /* *************************************************************************************
44 * Construct Method
45 */
46 public:
56 template <typename T, typename U, typename C>
57 BiConsumerMethod(Interface& c, void (C::*method)(T, U)) : vClass(c) {
58 this->vMethod = reinterpret_cast<void (Interface::*)(Interface&, Interface&)>(method);
59 return;
60 }
61
69 template <typename T, typename U>
71 return;
72 }
73
78 virtual ~BiConsumerMethod(void) override;
79
80 /* *************************************************************************************
81 * Operator Method
82 */
83 public:
91 template <typename T, typename U>
92 inline operator const BiConsumer<T, U>&(void) const {
93 const BiConsumer<>* src = this;
94 return *reinterpret_cast<const BiConsumer<T, U>*>(src);
95 }
96
103 template <typename T, typename U>
104 inline operator BiConsumer<T, U>&(void) {
105 BiConsumer<>* src = this;
106 return *reinterpret_cast<BiConsumer<T, U>*>(src);
107 }
108
109 /* *************************************************************************************
110 * Public Method <Override> mframe::func::BiConsumer<void*, void*>
111 */
112 public:
113 virtual void accept(Interface& t, Interface& u) override;
114
115 /* *************************************************************************************
116 * Public Method
117 */
118
119 /* *************************************************************************************
120 * Protected Method
121 */
122
123 /* *************************************************************************************
124 * Private Method
125 */
126
127 /* *************************************************************************************
128 * Static Variable
129 */
130
131 /* *************************************************************************************
132 * Static Method
133 */
134};
135
136/* ***************************************************************************************
137 * End of file
138 */
139
140#endif /* MFRAME_18F94E68_41A6_40F6_A880_DC5C066EEDFC */
Definition BiConsumerMethod.h:31
virtual ~BiConsumerMethod(void) override
Destroy the object.
BiConsumerMethod(Interface &c, void(C::*method)(T, U))
Construct a new Bi Consumer Method object.
Definition BiConsumerMethod.h:57
BiConsumerMethod(mframe::func::BiConsumer< T, U > biConsumer)
Construct a new Bi Consumer Method object.
Definition BiConsumerMethod.h:70
Definition Object.h:34
Definition BiConsumer.h:22
Definition BiConsumer.h:31
Definition Interface.h:134