mFrame
載入中...
搜尋中...
無符合項目
RunnableMethod.h
1
7#ifndef MFRAME_38FBA535_41BA_4F77_8153_DE72A1A4E9B6
8#define MFRAME_38FBA535_41BA_4F77_8153_DE72A1A4E9B6
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../func/Runnable.h"
18#include "./../lang/Object.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mframe::func {
24 class RunnableMethod;
25} // namespace mframe::func
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
32 /* *************************************************************************************
33 * Variable
34 */
35 private:
36 Interface& vClass;
37 void (Interface::*vMethod)(void);
38
39 /* *************************************************************************************
40 * Abstract Method
41 */
42
43 /* *************************************************************************************
44 * Construct Method
45 */
46 public:
51 template <typename C = Interface>
52 RunnableMethod(Interface& c, void (C::*methtod)(void)) : vClass(c) {
53 this->vMethod = reinterpret_cast<void (Interface::*)(void)>(methtod);
54 return;
55 }
56
61 virtual ~RunnableMethod(void) override;
62
63 /* *************************************************************************************
64 * Operator Method
65 */
66
67 /* *************************************************************************************
68 * Public Method <Override> - mframe::func::Runnable
69 */
70 public:
71 virtual void run(void) override;
72
73 /* *************************************************************************************
74 * Public Method
75 */
76
77 /* *************************************************************************************
78 * Protected Method
79 */
80
81 /* *************************************************************************************
82 * Private Method
83 */
84
85 /* *************************************************************************************
86 * Static Variable
87 */
88
89 /* *************************************************************************************
90 * Static Method
91 */
92};
93
94/* ***************************************************************************************
95 * End of file
96 */
97
98#endif /* MFRAME_38FBA535_41BA_4F77_8153_DE72A1A4E9B6 */
Definition RunnableMethod.h:31
RunnableMethod(Interface &c, void(C::*methtod)(void))
Construct a new object.
Definition RunnableMethod.h:52
virtual ~RunnableMethod(void) override
Destroy the object.
virtual void run(void) override
執行方法。
Definition Object.h:34
Definition BiConsumer.h:22
Definition Runnable.h:29
Definition Interface.h:134