mFrame
載入中...
搜尋中...
無符合項目
SupplierMethod.h
1
7#ifndef MFRAME_7CB5B2B6_EE12_4760_B144_0E8250AF90D9
8#define MFRAME_7CB5B2B6_EE12_4760_B144_0E8250AF90D9
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 SupplierMethod;
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& vClass;
37 Interface& (Interface::*vMethod)(void);
38 /* *************************************************************************************
39 * Abstract Method
40 */
41
42 /* *************************************************************************************
43 * Construct Method
44 */
45 public:
50 template <typename R, typename C>
51 SupplierMethod(Interface& c, C& (Supplier<C>::*method)(void)) : vClass(c) {
52 this->vMethod = reinterpret_cast<Interface& (Interface::*)(void)>(method);
53 return;
54 }
55
62 template <typename R>
64 return;
65 }
66
71 virtual ~SupplierMethod(void) override;
72
73 /* *************************************************************************************
74 * Operator Method
75 */
76 public:
83 template <typename R>
84 inline operator const Supplier<R>&(void) const {
85 const Supplier<R>* src = this;
86 return *reinterpret_cast<const Supplier<R>*>(this);
87 }
88
94 template <typename R>
95 inline operator Supplier<R>&(void) {
96 Supplier<R>* src = this;
97 return *reinterpret_cast<Supplier<R>*>(this);
98 }
99
100 /* *************************************************************************************
101 * Public Method <Override> mframe::func::Supplier<>
102 */
103 public:
104 virtual Interface& get(void) override;
105
106 /* *************************************************************************************
107 * Public Method
108 */
109
110 /* *************************************************************************************
111 * Protected Method
112 */
113
114 /* *************************************************************************************
115 * Private Method
116 */
117
118 /* *************************************************************************************
119 * Static Variable
120 */
121
122 /* *************************************************************************************
123 * Static Method
124 */
125};
126
127/* ***************************************************************************************
128 * End of file
129 */
130
131#endif /* MFRAME_7CB5B2B6_EE12_4760_B144_0E8250AF90D9 */
Definition SupplierMethod.h:31
virtual Interface & get(void) override
SupplierMethod(Interface &c, C &(Supplier< C >::*method)(void))
Construct a new object.
Definition SupplierMethod.h:51
SupplierMethod(Supplier< R > &supplier)
Construct a new Supplier Method object.
Definition SupplierMethod.h:63
virtual ~SupplierMethod(void) override
Destroy the object.
Definition Object.h:34
Definition BiConsumer.h:22
Definition Supplier.h:31
Definition Interface.h:134