On Wed, 2009-10-14 at 04:29 +0100, Zhu, Yongsheng wrote:
> > Yongsheng, can you
> > review this so? It's ready to replace the current code in the "dbus-api"
> > branch.
> New solution uses boost bind and function to solve the issue. It should be
> workable.
> But I have a concern about private inheritance and boost bind. 
> When boost does binding for a instance and a function member of its base 
> classes, 
> if the class of the instance privately or protectedly
> inherits from its base class, boost binding could not access that function 
> and 
> raises errors.

The base class is only inaccessible in DBusObjectHelper. The class
registering the method in the base class has access to it. So this
example fails, as you said:

class Test2
{
public:
    void test2() {}
};

class DBusTest : public Test, private Test2
{
   DBusTest(DBusConnection *conn) :
     ....
   {
      m_object.add(this, &Test2::test2, "Private");
....

But this code here works:
     m_object.add(static_cast<Test2 *>(this), &Test2::test2, "Private");

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to