+ /**
+ * Get the value of a field from the table.
+ */
+
+ template <class T, class V>
+ bool get(T& value, V field) const
+ {
+ bool ret = pushField(field).get(value);
+ mScript.pop();
+ return ret;
+ }
+
+
+ template <class T, class V>
+ void setField(T field, V value)
+ {
+ mScript.push(field);
+ mScript.push(value);
+ setField();
+ }
+
+ void setField()
+ {
+ lua_settable(mScript.mState, index);
+ }
+
+
+ template <class T>
+ void setField(const std::string& field, T value)
+ {
+ setField(field.c_str(), value);
+ }
+ template <class T>
+ void setField(const char* field, T value)
+ {
+ mScript.push(value);
+ lua_setfield(mScript.mState, index, field);
+ }
+