[prev in list] [next in list] [prev in thread] [next in thread]
List: orocos-dev
Subject: [Orocos-Dev] boost::bind
From: Sander.Vandenbroucke () vandewiele ! com (Vandenbroucke Sander)
Date: 2006-04-20 9:09:57
Message-ID: CC092C670C482A4C954AB4D13743B60A0207789F () vdwmar13 ! vandewiele ! local
[Download RAW message or body]
Hi,
I created a template for a Task which can execute a member function
instead of a RunnableInterface, pretty much like an Event but with one
call-back.
In the constructor I expect a 'SlotFunction':
typedef boost::function<void()> SlotFunction;
MyPriorityTask(Seconds period, SlotFunction& _f)
:PeriodicTask(period,
PriorityThread<Priority>::Instance(), 0, false)
{
f = _f;
}
The compiler fails when I use my task:
MyPriorityTask<25> myTask(1, boost::bind(&LedBlink::step, &Blink0));
test.cpp:233: error: no matching function for call to
`ORO_CoreLib::MyPriorityTask<25>::MyPriorityTask(int,
boost::_bi::bind_t<void, boost::_mfi::mf0<void, LedBlink>,
boost::_bi::list1<boost::_bi::value<LedBlink*> > >)'
VDWTask.hpp:24: note: candidates are:
ORO_CoreLib::MyPriorityTask<25>::MyPriorityTask(const
ORO_CoreLib::MyPriorityTask<25>&)
VDWTask.hpp:44: note:
ORO_CoreLib::MyPriorityTask<Priority>::MyPriorityTask(ORO_CoreLib::secs,
ORO_CoreLib::nsecs, boost::function<void ()(), std::allocator<void> >&)
[with int Priority = 25]
VDWTask.hpp:34: note:
ORO_CoreLib::MyPriorityTask<Priority>::MyPriorityTask(ORO_CoreLib::Secon
ds, boost::function<void ()(), std::allocator<void> >&) [with int
Priority = 25]
Using
boost::function<void()> f = boost::bind(&LedBlink::step, &Blink0);
MyPriorityTask<25> myTask(1, boost::bind(&LedBlink::step, &Blink0));
Works just fine. Any hints?
Sander.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic