ReceivedDataStructure<> made noncopyable

This commit is contained in:
Pavel Kirienko
2016-07-29 17:24:18 +03:00
parent 8b434c7768
commit c2ba231741
2 changed files with 10 additions and 7 deletions
+4 -6
View File
@@ -14,18 +14,16 @@
template <typename DataType>
class SubscriptionCollector : uavcan::Noncopyable
{
typedef uavcan::ReceivedDataStructure<DataType> ReceivedDataStructType;
void handler(const ReceivedDataStructType& msg)
void handler(const DataType& msg)
{
this->msg.reset(new ReceivedDataStructType(msg));
this->msg.reset(new DataType(msg));
}
public:
std::auto_ptr<ReceivedDataStructType> msg;
std::auto_ptr<DataType> msg;
typedef uavcan::MethodBinder<SubscriptionCollector*,
void (SubscriptionCollector::*)(const ReceivedDataStructType&)> Binder;
void (SubscriptionCollector::*)(const DataType&)> Binder;
Binder bind() { return Binder(this, &SubscriptionCollector::handler); }
};