@@ -316,6 +316,22 @@ namespace kaguya
316316 return *this ;
317317 }
318318
319+ // / @brief add member property with setter, getter functions.(experimental)
320+ // / @param name function name for lua
321+ // / @param getter getter function
322+ // / @param setter setter function
323+ template <typename GetType>
324+ UserdataMetatable& addProperty (const char * name, GetType(*getter)(const class_type*))
325+ {
326+ if (has_key (name))
327+ {
328+ throw KaguyaException (" already registered." );
329+ return *this ;
330+ }
331+ property_map_[name] = AnyDataPusher (function (getter));
332+ return *this ;
333+ }
334+
319335 // / @brief add member property with setter, getter functions.(experimental)
320336 // / @param name function name for lua
321337 // / @param getter getter function
@@ -332,6 +348,23 @@ namespace kaguya
332348 return *this ;
333349 }
334350
351+
352+ // / @brief add member property with external setter, getter functions.(experimental)
353+ // / @param name function name for lua
354+ // / @param getter getter function
355+ // / @param setter setter function
356+ template <typename GetType, typename SetType>
357+ UserdataMetatable& addProperty (const char * name, GetType(*getter)(const class_type*), void (*setter)(class_type*, SetType))
358+ {
359+ if (has_key (name))
360+ {
361+ throw KaguyaException (" already registered." );
362+ return *this ;
363+ }
364+ property_map_[name] = AnyDataPusher (overload (getter, setter));
365+ return *this ;
366+ }
367+
335368 // / @brief add non member function
336369 // / @param name function name for lua
337370 // / @param f function
0 commit comments