diff --git a/src/embind/embind.js b/src/embind/embind.js index 9c5b52e8f..68cd0e7dc 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -947,7 +947,7 @@ function __embind_register_class_class_function( }); } -function __embind_register_class_field( +function __embind_register_class_property( rawClassType, fieldName, rawFieldType, diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index 2c4df7d30..1923013f8 100755 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -128,7 +128,7 @@ namespace emscripten { size_t memberFunctionSize, void* memberFunction); - void _embind_register_class_field( + void _embind_register_class_property( TYPEID classType, const char* fieldName, TYPEID fieldType, @@ -363,17 +363,17 @@ namespace emscripten { } }; - template - struct FieldAccess { - typedef FieldType ClassType::*MemberPointer; - typedef internal::BindingType FieldBinding; - typedef typename FieldBinding::WireType WireType; + template + struct MemberAccess { + typedef MemberType ClassType::*MemberPointer; + typedef internal::BindingType MemberBinding; + typedef typename MemberBinding::WireType WireType; static WireType get( ClassType& ptr, const MemberPointer& field ) { - return FieldBinding::toWireType(ptr.*field); + return MemberBinding::toWireType(ptr.*field); } static void set( @@ -381,7 +381,7 @@ namespace emscripten { const MemberPointer& field, WireType value ) { - ptr.*field = FieldBinding::fromWireType(value); + ptr.*field = MemberBinding::fromWireType(value); } template @@ -389,7 +389,7 @@ namespace emscripten { ClassType& ptr, const Getter& getter ) { - return FieldBinding::toWireType(getter(ptr)); + return MemberBinding::toWireType(getter(ptr)); } template @@ -398,7 +398,7 @@ namespace emscripten { const Setter& setter, WireType value ) { - setter(ptr, FieldBinding::fromWireType(value)); + setter(ptr, MemberBinding::fromWireType(value)); } }; @@ -424,8 +424,8 @@ namespace emscripten { internal::_embind_register_tuple_element( internal::TypeID::get(), internal::TypeID::get(), - reinterpret_cast(&internal::FieldAccess::get), - reinterpret_cast(&internal::FieldAccess::set), + reinterpret_cast(&internal::MemberAccess::get), + reinterpret_cast(&internal::MemberAccess::set), sizeof(field), &field); @@ -437,10 +437,10 @@ namespace emscripten { internal::_embind_register_tuple_element_accessor( internal::TypeID::get(), internal::TypeID::get(), - reinterpret_cast(&internal::FieldAccess::template propertyGet), + reinterpret_cast(&internal::MemberAccess::template propertyGet), sizeof(getter), &getter, - reinterpret_cast(&internal::FieldAccess::template propertySet), + reinterpret_cast(&internal::MemberAccess::template propertySet), sizeof(setter), &setter); return *this; @@ -451,10 +451,10 @@ namespace emscripten { internal::_embind_register_tuple_element_accessor( internal::TypeID::get(), internal::TypeID::get(), - reinterpret_cast(&internal::FieldAccess::template propertyGet), + reinterpret_cast(&internal::MemberAccess::template propertyGet), sizeof(getter), &getter, - reinterpret_cast(&internal::FieldAccess::template propertySet), + reinterpret_cast(&internal::MemberAccess::template propertySet), sizeof(setter), &setter); return *this; @@ -465,10 +465,10 @@ namespace emscripten { internal::_embind_register_tuple_element_accessor( internal::TypeID::get(), internal::TypeID::get(), - reinterpret_cast(&internal::FieldAccess::template propertyGet), + reinterpret_cast(&internal::MemberAccess::template propertyGet), sizeof(getter), &getter, - reinterpret_cast(&internal::FieldAccess::template propertySet), + reinterpret_cast(&internal::MemberAccess::template propertySet), sizeof(setter), &setter); return *this; @@ -479,10 +479,10 @@ namespace emscripten { internal::_embind_register_tuple_element_accessor( internal::TypeID::get(), internal::TypeID::get(), - reinterpret_cast(&internal::FieldAccess::template propertyGet), + reinterpret_cast(&internal::MemberAccess::template propertyGet), sizeof(getter), &getter, - reinterpret_cast(&internal::FieldAccess::template propertySet), + reinterpret_cast(&internal::MemberAccess::template propertySet), sizeof(setter), &setter); return *this; @@ -510,8 +510,8 @@ namespace emscripten { internal::TypeID::get(), fieldName, internal::TypeID::get(), - reinterpret_cast(&internal::FieldAccess::get), - reinterpret_cast(&internal::FieldAccess::set), + reinterpret_cast(&internal::MemberAccess::get), + reinterpret_cast(&internal::MemberAccess::set), sizeof(field), &field); @@ -799,15 +799,15 @@ namespace emscripten { } template - class_& field(const char* fieldName, FieldType ClassType::*field) { + class_& property(const char* fieldName, FieldType ClassType::*field) { using namespace internal; - _embind_register_class_field( + _embind_register_class_property( TypeID::get(), fieldName, TypeID::get(), - reinterpret_cast(&FieldAccess::get), - reinterpret_cast(&FieldAccess::set), + reinterpret_cast(&MemberAccess::get), + reinterpret_cast(&MemberAccess::set), sizeof(field), &field); return *this;