I'm having some trouble resolving the call to read_until
(see snippet below)
Is there some reason I am not be able to use a boost::function
as the MatchCondition object?
Thanks,
...m
_______________
[MyClass.h]
class MyClass {
...
typedef
boost::asio::buffers_iteratorboost::asio::streambuf::const_buffers_type
t_Iterator;
typedef std::pair t_ConditionPair;
boost::asio::serial_port _port;
boost::asio::streambuf _readBuffer;
t_ConditionPair myCondition(t_Iterator begin, t_Iterator end);
void doRead();
...
};
[MyClass.cpp]
MyClass::t_ConditionPair myCondition(t_Iterator begin, t_Iterator end)
{
t_ConditionPair theCondition;
theCondition.first = end;
theCondition.second = true;
return theCondition;
}
void MyClass::doRead() {
...
boost::asio::read_until(
_port,
_readBuffer,
boost::bind(
&MyClass::myCondition,
this,
_1,
_2
)
);
...
}