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 :)