MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / MProperty

Method MProperty

Source/Engine/Scripting/Runtime/DotNet.cpp:1642–1659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1640}
1641
1642MProperty::MProperty(MClass* parentClass, const char* name, void* handle, void* getterHandle, void* setterHandle, MMethodAttributes getterAttributes, MMethodAttributes setterAttributes)
1643 : _parentClass(parentClass)
1644 , _name(parentClass->GetAssembly()->AllocString(name))
1645 , _handle(handle)
1646 , _hasCachedAttributes(false)
1647 , _attributes(&parentClass->GetAssembly()->Memory)
1648{
1649 _hasGetMethod = getterHandle != nullptr;
1650 if (_hasGetMethod)
1651 _getMethod = parentClass->GetAssembly()->Memory.New<MMethod>(parentClass, GetPropertyMethodName(this, StringAnsiView("get_", 4)), getterHandle, 0, getterAttributes);
1652 else
1653 _getMethod = nullptr;
1654 _hasSetMethod = setterHandle != nullptr;
1655 if (_hasSetMethod)
1656 _setMethod = parentClass->GetAssembly()->Memory.New<MMethod>(parentClass, GetPropertyMethodName(this, StringAnsiView("set_", 4)), setterHandle, 1, setterAttributes);
1657 else
1658 _setMethod = nullptr;
1659}
1660
1661MProperty::~MProperty()
1662{

Callers

nothing calls this directly

Calls 2

AllocStringMethod · 0.80
StringAnsiViewClass · 0.50

Tested by

no test coverage detected