I'm trying to make a connection between a function in one class so that I can call it in another class. The answers I've found are either too specific or maybe I'm missing something because I cannot for the life of me figure out what I'm doing wrong. Also, I'm a bit new to the boost library so please excuse any dumb questions I may ask.
The setup for my workflow is basically this...
class MyClass : public BaseClass {
void setup();
void myFunc(datatype);
OtherClass myOtherClass;
}
void setup()
{
OtherNamespace::addListener(this, myOtherClass);
}
namespace OtherNamespace {
class OtherClass {
signals::signal<void (datatype)> myConnection;
}
template<class A, class B>
void addListener(A * app, B & connection)
{
connection.myConnection.connect( 'I don't know what to do here' );
}
}
Basically, the addlistener function won't make the connection between the signal and the function. I know that where I don't know what to do I'm doing something wrong but I just can't figure out what about it is wrong. I'm making this as a helper function so that I can pass functions from one class to another then call them when they're attached. I'm trying to create a domino event from a websocket connection and I am clearly missing something very important. Any help would be truly appreciated.
I'm on xcode and boost and macbook pro.