<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi, <br>
    </p>
    <p>I am trying to modify the example "consumer-with-timer" in
      ndn-cxx to be able to set a parameter name on the delayInterest
      method so it will look like delayedInterest(const Name& name)</p>
    <p>When trying to schedule a new event using this code:</p>
    <p> m_scheduler.scheduleEvent(time::seconds(10),<br>
                                   
      bind(&ConsumerWithTimer::delayedInterest, ref(name)));<br>
    </p>
    <p>I get this compilation error: <br>
    </p>
    <p><i>../examples/consumer-with-timer.cpp: In member function ‘void
        ndn::examples::ConsumerWithTimer::run()’:</i><i><br>
      </i><i>../examples/consumer-with-timer.cpp:62:78: error: no
        matching function for call to
        ‘ndn::util::scheduler::Scheduler::scheduleEvent(boost::chrono::seconds,
        std::_Bind_helper<false, void
        (ndn::examples::ConsumerWithTimer::*)(const ndn::Name&),
        ndn::examples::ConsumerWithTimer* const>::type)’</i><i><br>
      </i><i>                              
        bind(&ConsumerWithTimer::delayedInterest, this));</i><i><br>
      </i><i>                                                                             
        ^</i><i><br>
      </i><i>../examples/consumer-with-timer.cpp:62:78: note: candidate
        is:</i><i><br>
      </i><i>In file included from
        ../examples/consumer-with-timer.cpp:28:0:</i><i><br>
      </i><i>/home/ubuntu/ndn-cxx/src/util/scheduler.hpp:135:3: note:
        ndn::util::scheduler::EventId
ndn::util::scheduler::Scheduler::scheduleEvent(boost::chrono::nanoseconds,
        const EventCallback&)</i><i><br>
      </i><i>   scheduleEvent(time::nanoseconds after, const
        EventCallback& callback);</i><i><br>
      </i><i>   ^</i><i><br>
      </i><i>/home/ubuntu/ndn-cxx/src/util/scheduler.hpp:135:3: note:  
        no known conversion for argument 2 from
        ‘std::_Bind_helper<false, void
        (ndn::examples::ConsumerWithTimer::*)(const ndn::Name&),
        ndn::examples::ConsumerWithTimer* const>::type {aka
        std::_Bind<std::_Mem_fn<void
        (ndn::examples::ConsumerWithTimer::*)(const
        ndn::Name&)>(ndn::examples::ConsumerWithTimer*)>}’ to
        ‘const EventCallback& {aka const
        std::function<void()>&}’</i><i><br>
      </i><i>../examples/consumer-with-timer.cpp: In member function
        ‘void ndn::examples::ConsumerWithTimer::delayedInterest(const
        ndn::Name&)’:</i><i><br>
      </i><i>../examples/consumer-with-timer.cpp:111:83: error: no
        matching function for call to
        ‘ndn::util::scheduler::Scheduler::scheduleEvent(boost::chrono::seconds,
        std::_Bind_helper<false, void
        (ndn::examples::ConsumerWithTimer::*)(const ndn::Name&),
        std::reference_wrapper<const ndn::Name> >::type)’</i><i><br>
      </i><i>                              
        bind(&ConsumerWithTimer::delayedInterest, ref(name)));</i><i><br>
      </i><i>                                                                                  
        ^</i><i><br>
      </i><i>../examples/consumer-with-timer.cpp:111:83: note: candidate
        is:</i><i><br>
      </i><i>In file included from
        ../examples/consumer-with-timer.cpp:28:0:</i><i><br>
      </i><i>/home/ubuntu/ndn-cxx/src/util/scheduler.hpp:135:3: note:
        ndn::util::scheduler::EventId
ndn::util::scheduler::Scheduler::scheduleEvent(boost::chrono::nanoseconds,
        const EventCallback&)</i><i><br>
      </i><i>   scheduleEvent(time::nanoseconds after, const
        EventCallback& callback);</i><i><br>
      </i><i>   ^</i><i><br>
      </i><i>/home/ubuntu/ndn-cxx/src/util/scheduler.hpp:135:3: note:  
        no known conversion for argument 2 from
        ‘std::_Bind_helper<false, void
        (ndn::examples::ConsumerWithTimer::*)(const ndn::Name&),
        std::reference_wrapper<const ndn::Name> >::type {aka
        std::_Bind<std::_Mem_fn<void
        (ndn::examples::ConsumerWithTimer::*)(const
        ndn::Name&)>(std::reference_wrapper<const
        ndn::Name>)>}’ to ‘const EventCallback& {aka const
        std::function<void()>&}’</i><br>
    </p>
    <p>Any idea? <br>
    </p>
    <p>How can I schedule an event using methods with parameters? <br>
    </p>
    <p>Thanks</p>
    <p>Junior<br>
    </p>
  </body>
</html>