@@ -50,31 +50,101 @@ namespace core {
50
50
// [-------------------------------------------------------]
51
51
52
52
53
-
54
53
// [-------------------------------------------------------]
55
54
// [ Classes ]
56
55
// [-------------------------------------------------------]
56
+ /* *
57
+ * @class
58
+ * ClassMethod
59
+ *
60
+ * @brief
61
+ * Represents a method for a class.
62
+ *
63
+ * This class represents a method for a class. It is used by the RTTI system to
64
+ * store metadata about a class method.
65
+ */
57
66
class ClassMethod : public RttiMember {
58
67
public:
59
68
69
+ /* *
70
+ * @brief Default constructor for the ClassMethod class.
71
+ *
72
+ * Initializes an instance of the ClassMethod class with a default name and a nullptr
73
+ * as the function to be invoked.
74
+ */
60
75
ClassMethod ();
61
76
77
+ /* *
78
+ * @brief Constructor for the ClassMethod class.
79
+ *
80
+ * Initializes an instance of the ClassMethod class with a specified name and a
81
+ * function to be invoked.
82
+ *
83
+ * @param name The name of the method.
84
+ * @param func The function to be invoked.
85
+ */
62
86
ClassMethod (const String& name, FuncBase* func);
63
87
88
+ /* *
89
+ * @brief Destructor for the ClassMethod class.
90
+ *
91
+ * Cleans up any resources associated with the ClassMethod instance.
92
+ */
64
93
~ClassMethod () override ;
65
94
66
95
96
+ /* *
97
+ * @brief
98
+ * Checks if the current ClassMethod instance is equal to another one.
99
+ *
100
+ * This method checks if the current ClassMethod instance is equal to
101
+ * another ClassMethod instance. Two ClassMethod instances are considered
102
+ * equal if they have the same name and the same function associated.
103
+ *
104
+ * @param[in] other The other ClassMethod instance to compare with.
105
+ *
106
+ * @return True if the current ClassMethod instance is equal to the other
107
+ * one, false otherwise.
108
+ */
67
109
bool operator ==(const ClassMethod& other) const ;
68
110
69
111
112
+ /* *
113
+ * @brief
114
+ * Invokes the method with the specified arguments.
115
+ *
116
+ * This method calls the underlying function associated with this ClassMethod
117
+ * instance, passing the provided arguments to it, and returns the result.
118
+ *
119
+ * @param[in] args A vector of DynamicObjects representing the arguments to
120
+ * invoke the function with.
121
+ *
122
+ * @return A DynamicObject containing the result of the method invocation.
123
+ */
70
124
DynamicObject invoke (Vector<DynamicObject>* args) override ;
71
125
126
+ /* *
127
+ * @brief
128
+ * Directly calls the method with the given arguments.
129
+ *
130
+ * This method directly calls the method with the given arguments. It is
131
+ * a low-level call and does not perform any of the additional checks
132
+ * that the `invoke` method performs.
133
+ *
134
+ * @param obj The object to call the method on.
135
+ * @param args... The arguments to pass to the method.
136
+ *
137
+ * @return The return value of the method.
138
+ */
72
139
template <typename TReturn, typename TObject, typename ... TArgs>
73
- inline TReturn call_direct (TObject* obj, TArgs... args) const ;
140
+ TReturn call_direct (TObject* obj, TArgs... args) const ;
74
141
75
142
private:
76
143
144
+ /* * Name of the method. */
77
145
String mName ;
146
+
147
+ /* * Pointer to the function to be invoked. */
78
148
FuncBase* mFunc ;
79
149
};
80
150
0 commit comments