comparison libinterp/octave-value/cdef-class.cc @ 30141:58f043641a78

maint: use "m_" prefix for member variables in class ctor_analyzer. * cdef-class.cc: Use "m_" prefix for member variables in class ctor_analyzer.
author Rik <rik@octave.org>
date Wed, 08 Sep 2021 16:02:04 -0700
parents 0e0cc2760540
children 03ff3f1020cf
comparison
equal deleted inserted replaced
30140:a001811a68e6 30141:58f043641a78
132 public: 132 public:
133 133
134 ctor_analyzer (void) = delete; 134 ctor_analyzer (void) = delete;
135 135
136 ctor_analyzer (const std::string& ctor, const std::string& obj) 136 ctor_analyzer (const std::string& ctor, const std::string& obj)
137 : tree_walker (), who (ctor), obj_name (obj) { } 137 : tree_walker (), m_who (ctor), m_obj_name (obj) { }
138 138
139 ctor_analyzer (const ctor_analyzer&) = delete; 139 ctor_analyzer (const ctor_analyzer&) = delete;
140 140
141 ctor_analyzer& operator = (const ctor_analyzer&) = delete; 141 ctor_analyzer& operator = (const ctor_analyzer&) = delete;
142 142
162 { 162 {
163 t.expression ()->accept (*this); 163 t.expression ()->accept (*this);
164 } 164 }
165 165
166 std::list<cdef_class> get_constructor_list (void) const 166 std::list<cdef_class> get_constructor_list (void) const
167 { return ctor_list; } 167 { return m_ctor_list; }
168 168
169 // NO-OP 169 // NO-OP
170 170
171 void visit_anon_fcn_handle (tree_anon_fcn_handle&) { } 171 void visit_anon_fcn_handle (tree_anon_fcn_handle&) { }
172 void visit_argument_list (tree_argument_list&) { } 172 void visit_argument_list (tree_argument_list&) { }
203 void visit_while_command (tree_while_command&) { } 203 void visit_while_command (tree_while_command&) { }
204 void visit_do_until_command (tree_do_until_command&) { } 204 void visit_do_until_command (tree_do_until_command&) { }
205 205
206 void visit_superclass_ref (tree_superclass_ref& t) 206 void visit_superclass_ref (tree_superclass_ref& t)
207 { 207 {
208 if (t.method_name () == obj_name) 208 if (t.method_name () == m_obj_name)
209 { 209 {
210 std::string class_name = t.class_name (); 210 std::string class_name = t.class_name ();
211 211
212 cdef_class cls = lookup_class (class_name, false); 212 cdef_class cls = lookup_class (class_name, false);
213 213
214 if (cls.ok ()) 214 if (cls.ok ())
215 ctor_list.push_back (cls); 215 m_ctor_list.push_back (cls);
216 } 216 }
217 } 217 }
218 218
219 private: 219 private:
220 220
221 // The name of the constructor being analyzed. 221 // The name of the constructor being analyzed.
222 std::string who; 222 std::string m_who;
223 223
224 // The name of the first output argument of the constructor. 224 // The name of the first output argument of the constructor.
225 std::string obj_name; 225 std::string m_obj_name;
226 226
227 // The list of superclass constructors that are explicitly called. 227 // The list of superclass constructors that are explicitly called.
228 std::list<cdef_class> ctor_list; 228 std::list<cdef_class> m_ctor_list;
229 }; 229 };
230 230
231 void 231 void
232 cdef_class::cdef_class_rep::install_method (const cdef_method& meth) 232 cdef_class::cdef_class_rep::install_method (const cdef_method& meth)
233 { 233 {
253 253
254 if (! ret_list || ret_list->size () != 1) 254 if (! ret_list || ret_list->size () != 1)
255 error ("%s: invalid constructor output arguments", 255 error ("%s: invalid constructor output arguments",
256 meth.get_name ().c_str ()); 256 meth.get_name ().c_str ());
257 257
258 std::string obj_name = ret_list->front ()->name (); 258 std::string m_obj_name = ret_list->front ()->name ();
259 ctor_analyzer a (meth.get_name (), obj_name); 259 ctor_analyzer a (meth.get_name (), m_obj_name);
260 260
261 body->accept (a); 261 body->accept (a);
262 262
263 std::list<cdef_class> explicit_ctor_list 263 std::list<cdef_class> explicit_ctor_list
264 = a.get_constructor_list (); 264 = a.get_constructor_list ();