better fields
This commit is contained in:
@@ -8,6 +8,6 @@ enum KeepAlivePacketFields {
|
|||||||
KeepAliveId = 0
|
KeepAliveId = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
using KeepAliveFields = sp::FieldsBuilder<std::uint64_t>::Type;
|
using KeepAliveFields = std::tuple<std::uint64_t /*KeepAliveId*/>;
|
||||||
|
|
||||||
DeclarePacket(KeepAlive);
|
DeclarePacket(KeepAlive);
|
||||||
@@ -71,10 +71,15 @@ struct FieldsBuilder<> {
|
|||||||
using Type = std::tuple<>;
|
using Type = std::tuple<>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename... TFields>
|
||||||
|
struct FieldsBuilder<std::tuple<TFields...>> {
|
||||||
|
using Type = typename FieldsBuilder<TFields...>::Type;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename TField, typename... TFields>
|
template <typename TField, typename... TFields>
|
||||||
struct FieldsBuilder<TField, TFields...> {
|
struct FieldsBuilder<TField, TFields...> {
|
||||||
using Type = sp::tuple_cat_t<std::tuple<Field<TField>>, typename FieldsBuilder<TFields...>::Type>;
|
using Type = sp::tuple_cat_t<std::tuple<Field<TField>>, typename FieldsBuilder<TFields...>::Type>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace sp
|
} // namespace sp
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ struct MessageImplParsedOptions<option::DispatchImpl<TActual>, TOptions...> : pu
|
|||||||
template <typename TFields, typename... TOptions>
|
template <typename TFields, typename... TOptions>
|
||||||
struct MessageImplParsedOptions<option::FieldsImpl<TFields>, TOptions...> : public MessageImplParsedOptions<TOptions...> {
|
struct MessageImplParsedOptions<option::FieldsImpl<TFields>, TOptions...> : public MessageImplParsedOptions<TOptions...> {
|
||||||
static const bool HasFieldsImpl = true;
|
static const bool HasFieldsImpl = true;
|
||||||
using Fields = TFields;
|
using Fields = typename FieldsBuilder<TFields>::Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user