class MonoField

Encapsulates information about a single Mono (managed) field belonging to some managed class.

This object also allows you to set or retrieve values to/from specific instances containing the field.

Public

Methods

GetName

const String &GetName() const

Returns the name of the field.

GetType

MonoClass *GetType()

Returns the class representing the type of data the field holds.

Get

void Get(MonoObject *instance, void *outValue)

Retrieves value currently set in the field on the specified object instance.

If field is static object instance can be null.

GetBoxed

MonoObject *GetBoxed(MonoObject *instance)

Retrieves value currently set in the field on the specified object instance.

If field is static object instance can be null. If returned value is a value type it will be boxed.

Set

void Set(MonoObject *instance, void *value)

Sets a value for the field on the specified object instance.

If field is static object instance can be null.

HasAttribute

bool HasAttribute(MonoClass *monoClass)

Checks if field has an attribute of the specified type.

GetAttribute

MonoObject *GetAttribute(MonoClass *monoClass)

Returns an instance of an attribute of the specified type.

Returns null if the field doesn't have such an attribute.

GetVisibility

MonoMemberVisibility GetVisibility()

Returns field visibility in the class.

IsStatic

bool IsStatic()

Query if the field is static.

Private

Constructors

MonoField

MonoField(MonoClassField *field)

Fields

mName

String mName

mField

MonoClassField * mField

mFieldType

MonoClass * mFieldType