]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src-isv/tmp/accessor_reference.mediawiki
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src-isv / tmp / accessor_reference.mediawiki
1 =Accessor Reference=
2 Value Reference is a URI compatible string that represents a in-value path from a structure to a sub-structure. 
3 For example, to an element of an array (index) or map (key), or record field (field-name).
4
5 There are explicit references and label references. Explicit references are typed, they specify the datatype where the reference is applicable. for example "i-5" is read "Array index 5", or "n-name" is "Record field name".
6
7 Label references are more human readable, but must be used in correct context to be usable. For example reference "5" is ambiguous, it can mean array index 5, or map element by key 5:integer, or record field by name "5" - the reference depends on the data where it is applied. 
8
9 {| border="1" cellpadding="3" cellspacing="0" align="center"
10 |- style="background-color: #f9f9f9;"
11 |'''Node Type''' || '''Child Reference String Notation'''
12 |-
13 |Index Reference (Array, Union, Record) ||''i-<index>''
14 |-
15 |Key Reference (Map) ||''k-<key>''*
16 |- style="background-color: #f9f9f9;"
17 |Name Reference (Record, Union) ||''n-<field name>''**
18 |- style="background-color: #f9f9f9;"
19 |Component Reference (Optional, Union, Variant) ||v
20 |-
21 |Label Reference (Array, Union, Record, Optional, Variant) ||<string>**
22 |}
23  *) Key is ascii serialized with Variant String encoding
24  **) Names are escaped using URI escape rules [http://www.ietf.org/rfc/rfc2396.txt]
25
26 Path separator is '''/''', for example: ''nodes/SSINE/value/o/v''
27
28
29
30
31 ==Reference definitons==
32 The datatype definition for ChildReference is an union.
33
34   type ChildReference = | IndexReference     { childReference : Optional(ChildReference), index : Integer }
35                         | KeyReference       { childReference : Optional(ChildReference), key : Variant }
36                         | NameReference      { childReference : Optional(ChildReference), name : String }
37                         | ComponentReference { childReference : Optional(ChildReference) }
38                         | LabelReference     { childReference : Optional(ChildReference), label : String }
39
40 An event contains a modification to the data model.
41   type Event = | ArrayElementAdded     { reference : Optional( ChildReference ), index : Integer, value : Optional( Variant ) }
42                | ArrayElementRemoved   { reference : Optional( ChildReference ), index : Integer }
43                | MapEntryAdded         { reference : Optional( ChildReference ), key : Variant, value : Optional( Variant ) }
44                | MapEntryRemoved       { reference : Optional( ChildReference ), key : Variant }
45                | UnionValueAssigned    { reference : Optional( ChildReference ), tag : Integer, newValue : Optional( Variant ) }
46                | OptionalValueAssigned { reference : Optional( ChildReference ), newValue : Optional( Variant ) }
47                | OptionalValueRemoved  { reference : Optional( ChildReference ) }
48                | ValueAssigned         { reference : Optional( ChildReference ), newValue : Optional( Variant ) }
49                | InvalidatedEvent      { reference : Optional( ChildReference ) }
50   
51   type ChangeSet = { events : Event[] }
52
53 InterestSet describes how and what of a sub-tree is to be monitored.
54   type InterestSet = | BooleanInterestSet  { notification : Boolean, value : Boolean }
55                      | ByteInterestSet     { notification : Boolean, value : Boolean }
56                      | IntegerInterestSet  { notification : Boolean, value : Boolean }
57                      | LongInterestSet     { notification : Boolean, value : Boolean }
58                      | FloatInterestSet    { notification : Boolean, value : Boolean }
59                      | DoubleInterestSet   { notification : Boolean, value : Boolean }
60                      | StringInterestSet   { notification : Boolean, value : Boolean }
61                      | RecordInterestSet   { notification : Boolean, notifications : Boolean[], value : Boolean, values : Boolean[] }
62                      | ArrayInterestSet    { notification : Boolean, notifications : Integer[], value : Boolean, values : Integer[] }
63                      | MapInterestSet      { notification : Boolean, notifications : Variant[], value : Boolean, values : Variant[], componentInterest : InterestSet, componentInterests : Map( Variant, InterestSet ) }
64                      | OptionalInterestSet { notification : Boolean, value : Boolean, componentInterest : InterestSet }
65                      | UnionInterestSet    { notification : Boolean, value : Boolean, componentInterests : InterestSet[] }
66                      | VariantInterestSet  { notification : Boolean, value : Boolean, componentInterest : InterestSet, completeComponent : Boolean }