class
ManagedSerializableList
Allows access to an underlying managed list, or a cached version of that list that can be serialized/deserialized.
You can transfer an object in linked state to serialized state by calling serialize(). If an object is in serialized state you can call deserialize() to populated a managed object from the cached data.
Public
Constructors
ManagedSerializableList
ManagedSerializableList
Methods
~ManagedSerializableList
GetManagedInstance
Returns the internal managed instance of the list.
This will return null if the object is in serialized mode.
GetTypeInfo
Returns the type information for the internal list.
Resize
Changes the size of the list.
Operates on managed object if in linked state, or on cached data otherwise.
SetFieldData
Sets a new element value at the specified list index.
Operates on managed object if in linked state, or on cached data otherwise.
- arrayIdx
- Index at which to set the value.
- val
- Wrapper around the value to store in the list. Must be of the list element type.
GetFieldData
Returns the element value at the specified list index.
Operates on managed object if in linked state, or on cached data otherwise.
- arrayIdx
- Index at which to retrieve the value.
Returns: A wrapper around the element value in the list.
GetLength
Returns the size of the list.
Operates on managed object if in linked state, or on cached data otherwise.
Serialize
Serializes the internal managed object into a set of cached data that can be saved in memory/disk and can be deserialized later.
The internal managed object will be freed (if no other references to it). Calling serialize() again will have no result.
Deserialize
Deserializes a set of cached data into a managed object.
This action may fail in case the cached data contains a type that no longer exists in which case null is returned.
Returns: Newly created object initialized with the cached data.
staticCreateFromExisting
Creates a managed serializable list that references an existing managed list.
Created object will be in linked mode.
- managedInstance
- Constructed managed instance of the list to link with. Its type must correspond with the provided type info.
- typeInfo
- Type information for the list and its elements.
staticCreateNew
Creates a managed serializable list that creates and references a brand new managed list instance.
- typeInfo
- Type of the list to create.
- size
- Initial size of the list.
staticCreateManagedInstance
Creates a managed list instance.
- typeInfo
- Type of the list to create.
- size
- Initial size of the list.
staticGetRttiStatic
Protected
Methods
InitMonoObjects
Retrieves needed Mono types and methods.
Should be called before performing any operations with the managed object.
GetLengthInternal
Returns the size of the list.
Operates on the internal managed object.
SetFieldData
Sets a new element value at the specified array index.
Operates on the provided managed instance.
- obj
- Managed instance in which to set the data in.
- arrayIdx
- Index at which to set the value.
- val
- Wrapper around the value to store in the array. Must be of the array element type.
AddFieldDataInternal
Appends data to the end of the list.
Operates on the internal managed object.
staticCreateEmpty
Creates an empty and uninitialized object used for serialization purposes.