C++ interface inheritance problem
- by james t
Hey, i'm trying to create a c++ stomp client,
my client constructor is :
Client(std::string &server, short port, std::string &login, std::string &pass, Listener &listener);
it gets a listener object which when Listener is the following interface :
class Listener {
virtual void message(StmpMessage message) =0;
};
now i attempt to instantiate a client in a test class :
class test : public virtual Listener {
public:
void message(StmpMessage message) {
message.prettyPrint();
}
int main(int argc, char* argv[])
{
Client client("127.0.0.1", 61613, *this);
return 0;
}
};
i'm sending this to the client because this is a listener object,
i get the following error :
/Users/mzruya/Documents/STOMPCPP/main.cpp:18: error: no matching function for call to 'Client::Client(const char [10], int, test&)'
/Users/mzruya/Documents/STOMPCPP/Client.h:43: note: candidates are: Client::Client(std::string&, short int, std::string&, std::string&, Listener&)
/Users/mzruya/Documents/STOMPCPP/Client.h:37: note: Client::Client(const Client&)