freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [FR-devel] Added simple links in databus


From: Curt Hibbs
Subject: RE: [FR-devel] Added simple links in databus
Date: Fri, 13 Sep 2002 04:36:43 -0700

Very nice!

Curt

PS
   Don't forget to update the wiki with this new info.

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of Rich
> Kilmer
> Sent: Thursday, September 12, 2002 9:19 PM
> To: FreeRIDE
> Subject: [FR-devel] Added simple links in databus
> 
> 
> As the subject says, I added the ability to create simple links in the
> databus between two paths.  So if you have a slot:
> 
> db = FreeBASE::DataBus.new
> slot1 = db['slot1']
> 
> You can create a link to another path in the databus:
> 
> slot1.link("subslot1", "/slot2/subslot2")
> 
> Then if you access subslot1:
> 
> puts db['slot1/subslot1'].path #=> /slot2/subslot2
> 
> I also added:
> 
> slot1.is_linked?("subslot1") #=> true 
> 
> and
> 
> slot1.unlink("subslot1")
> 
> The reason I call this simple linking is that if you traverse a relative
> path through a link you could have problems:
> 
> db = FreeBASE::DataBus.new
> slot1 = db['slot1']
> slot1.link('subslot1', 'slot2/subslot2')
> 
> and then you go:
> 
> x = db['slot1/subslot1/..']
> puts x.path #=> /slot2
> 
> In other words, the links are a single (forward) direction.  Creating
> something like symbolic links in Linux that maintain their reverse
> direction would be very hard to do in the current databus architecture.
> 
> Why is this useful:
> 
> db = DataBus.new
> db['/system/ui/component/pool/EditPane/pane1']
> db['/system/ui/component/pool/EditPane/pane2']
> db['/system/ui/component/pool/EditPane/pane2']
> db['/system/ui/component/pool/EditPane'].link('current', '../pane1')
> 
> and then as you swith between panes:
> 
> db['/system/ui/component/pool/EditPane'].link('current', '../pane2')
> 
> but you will always reference the current pane by:
> 
> db['/system/ui/component/pool/EditPane/current']
> 
> Hope this makes sense.  I am going to look for opportunities in the GUI
> to use this.
> 
> Regards,
> 
> -rich
> 
> 
> 
> 
> _______________________________________________
> Freeride-devel mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/freeride-devel
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]