[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [FR-devel] modification to slot.
From: |
Rich Kilmer |
Subject: |
RE: [FR-devel] modification to slot. |
Date: |
Wed, 8 May 2002 19:18:02 -0400 |
Slots can be more than data holders. They can hold queues, stacks and
procs. We created a "manager" attribute for slots which can enable an
object API for that slot, and what slots are "below" it.
scratch = @bus["buffer/scratch"]
scratch.manager = BufferManager.new
...
...
scratch.manager.insert_char(1,"hallo")
...
...
This way, manager presents the API (insert_char) and also encapsulates
how it uses the slots below what is managing
(@bus["buffer/scratch/..."]). For example, you could have the scratch
capture a version of the buffer on an intermittent basis below the
["buffer/scratch"] path:
@bus["buffer/scratch/1"].data = "Foo"
@bus["buffer/scratch/2"].data = "Foo Bar"
Which could be persistent and be accessed as:
scratch.manager.snapshot
scratch.manager.roll_back
These are, of course, hypothetical.
Just trying to show ideas :-)
-Rich
> -----Original Message-----
> From: address@hidden [mailto:freeride-
> address@hidden On Behalf Of Yohanes Santoso
> Sent: Wednesday, May 08, 2002 6:32 PM
> To: FreeRIDE Devel
> Subject: [FR-devel] modification to slot.
>
> What do you think if slot delegates whatever msg it cannot understand
> to the data?
>
> So, instead of saying:
> currBuffer = @bus["buffer/scratch:1"]
> currBuffer.data.insert_char(1, "hallo")
>
> we use this:
> currBuffer.insert_char(1, "hallo")
>
> YS.
>
> _______________________________________________
> Freeride-devel mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/freeride-devel