|
|
|
@ -39,7 +39,7 @@ namespace client {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return allocSizeImpl(std::forward<decltype(t)>(t),
|
|
|
|
return allocSizeImpl(std::forward<decltype(t)>(t),
|
|
|
|
std::index_sequence_for<Ts...>());
|
|
|
|
std::index_sequence_for<Ts...>());
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Ts, size_t... Is>
|
|
|
|
template <typename... Ts, size_t... Is>
|
|
|
|
static std::tuple<std::array<index, sizeof...(Ts)>, index>
|
|
|
|
static std::tuple<std::array<index, sizeof...(Ts)>, index>
|
|
|
|
@ -53,11 +53,11 @@ namespace client {
|
|
|
|
return std::make_tuple(res,
|
|
|
|
return std::make_tuple(res,
|
|
|
|
size); // array of offsets into allocated buffer &
|
|
|
|
size); // array of offsets into allocated buffer &
|
|
|
|
// total number of floats to alloc
|
|
|
|
// total number of floats to alloc
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void convert(float* f, typename BufferT::type buf)
|
|
|
|
static void convert(float* f, typename BufferT::type buf)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
f[0] = static_cast<SCBufferAdaptor*>(buf.get())->bufnum();
|
|
|
|
f[0] = static_cast<float>(static_cast<SCBufferAdaptor*>(buf.get())->bufnum());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
@ -129,8 +129,7 @@ namespace client {
|
|
|
|
static index numTags(std::tuple<Ts...>&&)
|
|
|
|
static index numTags(std::tuple<Ts...>&&)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return std::tuple_size<std::tuple<Ts...>>::value;
|
|
|
|
return std::tuple_size<std::tuple<Ts...>>::value;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void getTag(Packet& p, typename BufferT::type) { p.addtag('i'); }
|
|
|
|
static void getTag(Packet& p, typename BufferT::type) { p.addtag('i'); }
|
|
|
|
|
|
|
|
|
|
|
|
@ -161,21 +160,21 @@ namespace client {
|
|
|
|
|
|
|
|
|
|
|
|
static void convert(Packet& p, typename BufferT::type buf)
|
|
|
|
static void convert(Packet& p, typename BufferT::type buf)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
p.addi(static_cast<SCBufferAdaptor*>(buf.get())->bufnum());
|
|
|
|
p.addi(static_cast<int>(static_cast<SCBufferAdaptor*>(buf.get())->bufnum()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
static std::enable_if_t<std::is_integral<T>::value>
|
|
|
|
static std::enable_if_t<std::is_integral<T>::value>
|
|
|
|
convert(Packet& p, T x)
|
|
|
|
convert(Packet& p, T x)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
p.addi(x);
|
|
|
|
p.addi(static_cast<int>(x));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
static std::enable_if_t<std::is_floating_point<T>::value>
|
|
|
|
static std::enable_if_t<std::is_floating_point<T>::value>
|
|
|
|
convert(Packet& p, T x)
|
|
|
|
convert(Packet& p, T x)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
p.addf(x);
|
|
|
|
p.addf(static_cast<float>(x));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void convert(Packet& p, std::string s)
|
|
|
|
static void convert(Packet& p, std::string s)
|
|
|
|
|