Wrapper for callback member function of class

I am trying to handle function callbacks in my library.

typedef void (*Callback)();

void SmartHouse::setEventCallback(int eventId, Callback c){
  _callbackFunctions.set(eventId,c);
}
//Invocation of this from outside of class will work fine
myObjectInstance.setEventCallback(1,someVoidFunction);

//To provide a default handler inside the library a call will lead to an <unresolved overloaded function type> exception
myObjectInstance.setEventCallback(1,SmartHouse::someVoidFunctionInsideTheClass);

I do understand the issue which is very well described here The Function Pointer Tutorials - Callbacks
Converting the function to a static function isn't possible as the callback needs to access non static fields.

As far as I understood another possibility is to pass a pointer (this) of my class instance to the function, but this would result in the need to change the function definition of callback to include a reference. Is this a correct assumption and is there another way to solve this issue? Changing the signature for every other function seems like a bad idea as this would result in a much worse usage of the library. Can we do some function overloading here to resolve everything?

Disclaimer: I am a greenhorn when it comes to C++ so go ahead and throw all the patterns and best practices at me.

Might help to post enough code so that things will actually compile.

class SmartHouse{
  public: 
    SmartHouse();
    typedef void (*Callback)();
    void setEventCallback(int eventID, Callback c); 
   private:
    void defaultHandler();
};

SmartHouse::SmartHouse(){
  //This will fail. Comment it out and we are fine
  setEventCallback(0,defaultHandler);
}
void SmartHouse::setEventCallback(int eventId, Callback c){}
void SmartHouse::defaultHandler(){}

SmartHouse house;

void setup() {}

void loop() {
  house.setEventCallback(0,someVoidFunction);
}

void someVoidFunction(){}

You've defined Callback as an ordinary function pointer, it is not a pointer to a class member function.

defaultHandler() is a class member, if you want to use that function as the default... then declare it static:

class SmartHouse{
  public: 
    SmartHouse();
    typedef void (*Callback)();
    void setEventCallback(int eventID, Callback c); 
   private:
    static void defaultHandler();  // Here <<<<<<<<<<<<<<<<
};

SmartHouse::SmartHouse(){
  //This will fail. Comment it out and we are fine
  setEventCallback(0,defaultHandler);
}
void SmartHouse::setEventCallback(int eventId, Callback c){}
void SmartHouse::defaultHandler(){}

SmartHouse house;

void setup() {}

void loop() {
  house.setEventCallback(0,someVoidFunction);
}

void someVoidFunction(){}

Which in the context of your function names, that makes particular sense, right?

BulldogLowell:
Which in the context of your function names, that makes particular sense, right?

Yes in this particular case it does make sense, but it was me who made a mistake with the minimal example as the default handler will access a field of the class which is non static therefore simply changing the function to be a static function does not work.

KilianB:
Yes in this particular case it does make sense, but it was me who made a mistake with the minimal example as the default handler will access a field of the class which is non static therefore simply changing the function to be a static function does not work.

hmmm... so in your example, someVoidFunction() accesses some object's member?

I'm having difficulty understanding what it is you are trying to do.