Instance class

Inheritance

Constructors

Instance(int _id, String _name, IResource _resource, IStore? _store, [TypeTemplate? customTemplate = null, int _instanceAge = 0])
Create new instance.

Properties

age int
Age of the instance, incremented by 1 in every modification.
getter/setter pair
attributes KeyList<String, dynamic>
Instance attributes are custom properties associated with the instance, a place to store information by IStore.
no setter
children AutoList<IResource, Instance>
List of children.
no setter
hashCode int
The hash code for this object.
no setterinherited
id int
Instance Id.
no setter
The unique and permanent link to the resource.
no setter
managers AutoList<IPermissionsManager, Instance>
Execution managers.
no setter
modificationDate DateTime?
Last modification date.
no setter
name String
Instance name.
getter/setter pair
parents AutoList<IResource, Instance>
List of parents.
no setter
properyModified Stream<PropertyModificationInfo>
no setterinherited
resource IResource
Resource managed by this instance.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store IStore?
Store responsible for creating and keeping the resource.
no setter
template TypeTemplate
Resource template describes the properties, functions and events of the resource.
no setter

Methods

applicable(Session session, ActionType action, MemberTemplate? member, [dynamic inquirer = null]) Ruling
Check for permission.
children_OnAdd(Instance parent, IResource value) → void
children_OnRemoved(Instance parent, IResource value) → void
deserialize(List<PropertyValue> properties) bool
Import properties from bytes array.
emitArgs(String event, List arguments) bool
inherited
emitModification(PropertyTemplate pt, dynamic value) → void
emitProperty(PropertyModificationInfo event) → void
inherited
emitResourceEvent(dynamic issuer, bool receivers(Session)?, EventTemplate eventTemplate, dynamic value) → dynamic
getAge(int index) int
Get the age of a given property index.
getAttributes([List<String>? attributes = null]) Map<String, dynamic>
getModificationDate(int index) DateTime
Get modification date of a specific property.
getPropertyValue(String name, ValueObject valueObject) bool
Get the value of a given property by name.
isStorable() bool
If True, the instance can be stored to disk.
loadProperty(String name, int age, DateTime modificationDate, dynamic value) bool
Load property value (used by stores)
modified(String propertyName) → dynamic
Notify listeners that a property was modified.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String event, Function? callback) → void
inherited
on(String event, Function callback) → void
inherited
parents_OnAdd(Instance parent, IResource value) → void
parents_OnRemoved(Instance parent, IResource value) → void
register(String event) → void
inherited
removeAttributes([List<String>? attributes = null]) bool
resource_OnDestroy(dynamic sender) → void
serialize() List<PropertyValue>
Export all properties with ResourceProperty attributed as bytes array.
setAge(int index, int value) → void
Set the age of a property.
setAttributes(Map<String, dynamic> attributes, [bool clearAttributes = false]) bool
setModificationDate(int index, DateTime value) → void
Set the modification date of a property.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited