WEBVTT

00:00:00.500 --> 00:00:03.247
The Shop installer creates a memory cell for the root.

00:00:04.147 --> 00:00:05.541
Its own data is empty.

00:00:06.439 --> 00:00:09.577
The lower compartment holds attachments to child memories.

00:00:10.476 --> 00:00:13.913
The installer fills those slots before Store installs the root.

00:00:14.812 --> 00:00:18.431
The installer attaches Branches to the branches slot, then Settings

00:00:18.444 --> 00:00:19.603
to the settings slot.

00:00:20.502 --> 00:00:23.236
Each Child Slot holds at most one child.

00:00:24.134 --> 00:00:27.012
Store installs the assembled tree as the actor root.

00:00:27.910 --> 00:00:31.009
Branches can now attach an inventory for each branch number

00:00:31.022 --> 00:00:32.051
in its Child Map.

00:00:34.200 --> 00:00:35.436
Open branch nine.

00:00:36.337 --> 00:00:39.436
Branches checks for that key in its child map and checks that

00:00:39.449 --> 00:00:41.168
it has room for another branch.

00:00:42.066 --> 00:00:43.446
Nine is free here.

00:00:44.345 --> 00:00:47.353
The method asks Inventory to create the memory for that branch

00:00:47.366 --> 00:00:49.006
inside the current write scope.

00:00:49.905 --> 00:00:53.173
Inventory uses its private memory key to create a cell with

00:00:53.186 --> 00:00:54.436
an empty item map.

00:00:55.334 --> 00:00:57.652
The constructor returns a Detached ticket.

00:00:58.551 --> 00:01:01.363
Branches can attach that ticket in this write scope.

00:01:02.262 --> 00:01:04.879
Branches attaches the inventory at key nine.

00:01:05.777 --> 00:01:07.548
Attaching consumes the ticket.

00:01:08.446 --> 00:01:10.334
That entry owns the inventory now.

00:01:11.233 --> 00:01:14.553
If Branches later takes the attachment out, the child comes

00:01:14.566 --> 00:01:15.946
back as a Detached ticket.

00:01:16.845 --> 00:01:20.048
A child left detached retires when the scope finishes.

00:01:22.200 --> 00:01:25.403
Inside the inventory, the item map will use a product number

00:01:25.416 --> 00:01:26.444
to find an item.

00:01:27.345 --> 00:01:30.926
The child map uses a branch number to find the inventory itself.

00:01:31.824 --> 00:01:34.949
Inventory holds the private key it will need to read or write

00:01:34.962 --> 00:01:35.561
its data.

00:01:36.459 --> 00:01:38.243
Branches owns the attachment.

00:01:39.142 --> 00:01:40.965
Its edge ends at the memory boundary.

00:01:41.863 --> 00:01:45.314
Follow the owning edges back from inventory nine, through Branches,

00:01:45.509 --> 00:01:46.603
to the actor's root.

00:01:47.501 --> 00:01:50.379
Settings reaches that same root through its own slot.

00:01:51.277 --> 00:01:54.337
The next checkout will use this inventory for stock and Settings

00:01:54.350 --> 00:01:55.040
for tax.

