Class MProperty
Encapsulates information about a single Mono managed property belonging to some managed class. This object also allows you to set or retrieve values to or from specific instances containing the property.
Inheritance
Assembly: FlaxEngine.dll
File: Engine/Scripting/ManagedCLR/MProperty.h
Syntax
public class MProperty
Constructors
~MProperty()
MProperty(MClass* parentClass, const char* name, void* handle, void* getterHandle, void* setterHandle, MMethodAttributes getterAttributes, MMethodAttributes setterAttributes)
Declaration
public MProperty(MClass* parentClass, const char* name, void* handle, void* getterHandle, void* setterHandle, MMethodAttributes getterAttributes, MMethodAttributes setterAttributes)
Parameters
MClass
parentClass
|
char
name
|
void
handle
|
void
getterHandle
|
void
setterHandle
|
MMethodAttributes
getterAttributes
|
MMethodAttributes
setterAttributes
|
Fields
_attributes
Declaration
protected Array<MObject* > _attributes
Field Value
Array<MObject >
|
_getMethod
_handle
Declaration
protected void* _handle
Field Value
void
|
_hasCachedAttributes
Declaration
protected int32 _hasCachedAttributes
Field Value
int32
|
_hasGetMethod
Declaration
protected int32 _hasGetMethod
Field Value
int32
|
_hasSetMethod
Declaration
protected int32 _hasSetMethod
Field Value
int32
|
_name
_parentClass
_setMethod
Methods
GetAttribute(const MClass* klass)
Returns an instance of an attribute of the specified type. Returns null if the property doesn't have such an attribute.
Declaration
public MObject* GetAttribute(const MClass* klass) const
Parameters
MClass
klass
The attribute class to take. |
Returns
MObject
The attribute object. |
GetAttributes()
Returns an instance of all attributes connected with given property. Returns null if the property doesn't have any attributes.
Declaration
public Array<MObject* > GetAttributes() const
Returns
Array<MObject >
The array of attribute objects. |
GetGetMethod()
GetName()
GetParentClass()
Returns the parent class that this method is contained with.
Declaration
public MClass* GetParentClass() const
Returns
MClass
|
GetSetMethod()
GetType()
Gets property type class.
Declaration
public MType* GetType() const
Returns
MType
|
GetValue(MObject* instance, MObject* *exception)
Retrieves value currently set in the property on the specified object instance. If property is static object instance can be null.
Value will be a pointer to raw data type for value types (for example int, float), and a MObject* for reference types.
Declaration
public MObject* GetValue(MObject* instance, MObject* *exception) const
Parameters
MObject
instance
The object of given type to get value from. |
MObject
exception
An optional pointer to the exception value to store exception object reference. |
Returns
MObject
The returned boxed value object. |
GetVisibility()
Gets property visibility in the class.
Declaration
public MVisibility GetVisibility() const
Returns
MVisibility
|
HasAttribute()
Checks if property has an attribute of any type.
Declaration
public bool HasAttribute() const
Returns
bool
True if has any custom attribute, otherwise false. |
HasAttribute(const MClass* klass)
Checks if property has an attribute of the specified type.
Declaration
public bool HasAttribute(const MClass* klass) const
Parameters
MClass
klass
The attribute class to check. |
Returns
bool
True if has attribute of that class type, otherwise false. |
IsStatic()
Returns true if property is static.
Declaration
public bool IsStatic() const
Returns
bool
|
SetValue(MObject* instance, void* value, MObject* *exception)
Sets a value for the property on the specified object instance. If property is static object instance can be null.
Value should be a pointer to raw data type for value types (for example int, float), and a MObject* for reference types.
Declaration
public void SetValue(MObject* instance, void* value, MObject* *exception) const
Parameters
MObject
instance
Object of given type to set value to. |
void
value
The value to set of undefined type. |
MObject
exception
An optional pointer to the exception value to store exception object reference. |