Fixed template instantiation of ServiceResponseTransferListener<>

This commit is contained in:
Pavel Kirienko
2015-04-21 21:51:21 +03:00
parent 78e2351df5
commit 2dbf8cd432
3 changed files with 20 additions and 19 deletions
@@ -115,7 +115,11 @@ public:
/**
* This helper class does some compile-time magic on the transport layer machinery. For authorized personnel only.
*/
template <typename DataStruct_, unsigned NumStaticReceivers_, unsigned NumStaticBufs_>
template <typename DataStruct_,
unsigned NumStaticReceivers_,
unsigned NumStaticBufs_,
template<unsigned, unsigned, unsigned> class TransferListenerTemplate = TransferListener
>
class UAVCAN_EXPORT TransferListenerInstantiationHelper
{
enum { DataTypeMaxByteLen = BitLenToByteLen<DataStruct_::MaxBitLen>::Result };
@@ -130,7 +134,7 @@ class UAVCAN_EXPORT TransferListenerInstantiationHelper
#endif
public:
typedef TransferListener<BufferSize, NumStaticBufs, NumStaticReceivers> Type;
typedef TransferListenerTemplate<BufferSize, NumStaticBufs, NumStaticReceivers> Type;
};
@@ -23,9 +23,9 @@ namespace uavcan
template <typename ServiceDataType>
class UAVCAN_EXPORT ServiceResponseTransferListenerInstantiationHelper
{
enum { DataTypeMaxByteLen = BitLenToByteLen<ServiceDataType::Response::MaxBitLen>::Result };
public:
typedef ServiceResponseTransferListener<DataTypeMaxByteLen> Type;
public: // so much templating it hurts
typedef typename TransferListenerInstantiationHelper<typename ServiceDataType::Response,
1, 1, ServiceResponseTransferListener>::Type Type;
};
/**