A property is a mix between a function and a variable. Properties are similar to C#'s getter/setter system. To Lua, a property looks like a normal variable, but every time that variable is read, a function is called. Similarly, every time the variable is changed, a function is called. These are getter/setter functions. If a property has a getter function but no setter, it is effectively read-only.
A property can be added with the addProperty (char const*, TG (T::*) () const, void (T::*) function. This function takes three arguments. The first one is the Lua name for the variable, and the second and third arguments are getter and setter functions, respectively. The addProperty function has an overloaded version that only takes a getter function. The following code demonstrates how to use properties:
int bar;
int get_bar () const {
// Potentially do some error...