0

I am modifying some code that spawns a thread and runs a class function. The original function was defined in ClassB as void ClassB::function(void). I now need to pass it a boolean value. I am done lots of research but I am just confused. Here is some psuedo code of the original.

ClassB
{
    void ClassB::openSocket(void)
    {
         ...
    }
}


ClassA
{
    ClassB m_manager;

    ClassA::Handler(bool side)
    {
        m_thread = Glib::Thread::create(sigc::mem_fun(m_manager, 
                            &ClassB::openSocket),false);
    }
}

The above code works fine. I am now trying to change to code to pass side in ClassA::Handler to openSocket in ClassB. Here is code of what I am trying to do (or what makes sense to me, even though it doesn't work).

ClassB
{
    void ClassB::openSocket(bool side) //changed to take a boolean parameter
    {
         ...
    }
}


ClassA
{
    ClassB m_manager;

    ClassA::Handler(bool side)
    {
        m_thread = Glib::Thread::create(sigc::mem_fun(m_manager, 
                            &ClassB::openSocket(side)),false); //BROKEN - I want to pass side to openSocket
    }
}

Any help would be greatly appreciated :)

Edited by lross1309: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by abhimanipal
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.