[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: mapping object paths to method calls
From:       Thiago Macieira <thiago.macieira () trolltech ! com>
Date:       2006-04-09 9:35:38
Message-ID: 200604091135.52095.thiago.macieira () trolltech ! com
[Download RAW message or body]


Chris Rebert wrote:
>I'm new at D-BUS and was wondering if it is possible to have an object
>path mapped to a method call, e.g. accessing /org/foo/bar/1123 would
>return the result of /org/foo/bar.someMeth("1123"). I couldn't find an
>answer in this list's archives or the documentation, so I'm doubtful
>this is possible.

It doesn't really make sense because an object path by itself is 
meaningless. You must have at least a method name associated in order to 
make anything useful with it.

What you seem to be asking, though, is something like we're used to in 
programming:
  Object obj = someMeth("1123")
  obj.anotherMeth(...)

is that it? Then, if so, there is no problem in your program having a 
method call that returns an object path. The only issue is that the 
object path has to exist at all times. There's no reference counting 
involved here -- unless you provide a Release method and remember to call 
it.

>My application will have a large database of objects accessible via an
>object path that incorporates their ids (e.g. /org/foo/bar/41254), and
>even using the flyweight pattern, I believe there would not be enough
>memory to register an object path for each object, therefore I would
>like to generate each object on demand if possible, as only a few of the
>many will be in use at any one time.
>If you have any ideas on how to accomplish this, I would be most
>appreciative.

See above.

Registering the object depends on how your binding does it. Technically 
speaking, with a message filter, you could catch the call to any object, 
without the need to call any specific "register object" function.

-- 
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic