та самая функция строка 1317 выделена жирнымlinux/hub.cc: In static member function ‘static void Hub::music_patch(char*, char*, void*)’:
linux/hub.cc error: no matching function for call to ‘Func1<Hub, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Func1(Hub*&, void (Hub::*)(std::string, bool), std::basic_string<char, std::char_traits<char>, std::allocator<char> >)’
linux/func.hh:62: note: candidates are: Func1<c, p1>::Func1(c*, void (c::*)(p1), p1) [with c = Hub, p1 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >]
linux/func.hh:60: note: Func1<Hub, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Func1(const Func1<Hub, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&)
Код: Выделить всё
//music patch by todeus.
void Hub::music_patch(char* In, char* Out, gpointer data){
Hub *hub = (Hub *)data;
int ret = system(In);
char str[256];
typedef Func1<Hub, string> F1;
FILE *F = fopen("/tmp/nowplaying","r");
str[fread(str,1,256,F)-1] = '\0';
[b]F1 *func1 = new F1(hub, &Hub::sendMessage_client,string(Out)+ string(str));[/b]
fclose(F);
WulforManager::get()->dispatchClientFunc(func1);
}
Код: Выделить всё
template<class c, typename p1>
class Func1: public FuncBase
[b]{[/b]
public:
[b]Func1(c *obj, void (c::*func)(p1), p1 param1):[/b]
_param1(param1)
{
this->obj = obj;
this->func = func;
}
void call() {
(*obj.*func)(_param1);
}
const std::string& getID()
{
return obj->getID();
}
private:
c *obj;
void (c::*func)(p1);
p1 _param1;
};