Poller::Poller(Network::IOStrand* str, const Network::IOCallback& cb, const Duration& max_rate, bool accurate) : mStrand(str), mTimer( Network::IOTimer::create(str->service()) ), mMaxRate(max_rate), mAccurate(accurate), mUnschedule(false), mUserCB(cb) { Network::IOTimerWPtr wtimer(mTimer->shared_from_this()); mCB= mStrand->wrap(std::tr1::bind(&Poller::handleExec, this, wtimer)); mTimer->setCallback(mCB); }
Poller::Poller(Network::IOStrand* str, const Network::IOCallback& cb, const char* cb_tag, const Duration& max_rate, bool accurate) : mStrand(str), mTimer( Network::IOTimer::create(str->service()) ), mMaxRate(max_rate), mAccurate(accurate), mUnschedule(false), mUserCB(cb), mCBTag(cb_tag) #if SIRIKATA_DEBUG , mPollerRunCount(0) #endif { Network::IOTimerWPtr wtimer(mTimer->shared_from_this()); mCB = mStrand->wrap(std::tr1::bind(&Poller::handleExec, this, wtimer)); mTimer->setCallback(mCB); }