#include <boost/bind.hpp>
#include <boost/thread.hpp>

#include <iostream>


class BufferMoniter
{
public:
void maitain()
{
std::cout <<" BufferMoniter" << std::endl;
}
};
class LocalPeer
{
public:
template <class T>
void caller(unsigned int interval,T t)
{
//do something
t();
}
void fork()
{
BufferMoniter *pBuffer=new BufferMoniter( );
boost::thread thrd(caller(500,boost::bind(&BufferMoniter::maitain,pBuffer)) ;
// that i really want.a fuctor of caller(500,boost::bind(&BufferMoniter::maitain,pBuffer).

thre.join();
}

};
//many thanks
 
 






想加入吗?1.9亿用户正在使用网易邮箱 www.126.com