[struct_pack] support 256 field (#688)
This commit is contained in:
parent
9a7b36ac0a
commit
9d2966424e
|
@ -15,23 +15,10 @@
|
|||
*/
|
||||
#pragma once
|
||||
// clang-format off
|
||||
#define STRUCT_PACK_ARG_COUNT(...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_INTERNAL_ARG_COUNT(0, ##__VA_ARGS__,\
|
||||
64, 63, 62, 61, 60, \
|
||||
59, 58, 57, 56, 55, 54, 53, 52, 51, 50, \
|
||||
49, 48, 47, 46, 45, 44, 43, 42, 41, 40, \
|
||||
39, 38, 37, 36, 35, 34, 33, 32, 31, 30, \
|
||||
29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \
|
||||
19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \
|
||||
9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
|
||||
#define STRUCT_PACK_ARG_COUNT(...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_INTERNAL_ARG_COUNT(0, ##__VA_ARGS__,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0))
|
||||
|
||||
#define STRUCT_PACK_INTERNAL_ARG_COUNT(\
|
||||
_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, \
|
||||
_10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \
|
||||
_20, _21, _22, _23, _24, _25, _26, _27, _28, _29, \
|
||||
_30, _31, _32, _33, _34, _35, _36, _37, _38, _39, \
|
||||
_40, _41, _42, _43, _44, _45, _46, _47, _48, _49, \
|
||||
_50, _51, _52, _53, _54, _55, _56, _57, _58, _59, \
|
||||
_60, _61, _62, _63, _64, N, ...) N
|
||||
_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64,_65,_66,_67,_68,_69,_70,_71,_72,_73,_74,_75,_76,_77,_78,_79,_80,_81,_82,_83,_84,_85,_86,_87,_88,_89,_90,_91,_92,_93,_94,_95,_96,_97,_98,_99,_100,_101,_102,_103,_104,_105,_106,_107,_108,_109,_110,_111,_112,_113,_114,_115,_116,_117,_118,_119,_120,_121,_122,_123,_124, N, ...) N
|
||||
|
||||
#define STRUCT_PACK_CONCAT_(l, r) l ## r
|
||||
#define STRUCT_PACK_CONCAT(l, r) STRUCT_PACK_CONCAT_(l, r)
|
||||
|
@ -103,6 +90,66 @@
|
|||
#define STRUCT_PACK_DOARG62(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG61(s,f,__VA_ARGS__)) s f(61,t)
|
||||
#define STRUCT_PACK_DOARG63(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG62(s,f,__VA_ARGS__)) s f(62,t)
|
||||
#define STRUCT_PACK_DOARG64(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG63(s,f,__VA_ARGS__)) s f(63,t)
|
||||
#define STRUCT_PACK_DOARG65(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG64(s,f,__VA_ARGS__)) s f(64,t)
|
||||
#define STRUCT_PACK_DOARG66(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG65(s,f,__VA_ARGS__)) s f(65,t)
|
||||
#define STRUCT_PACK_DOARG67(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG66(s,f,__VA_ARGS__)) s f(66,t)
|
||||
#define STRUCT_PACK_DOARG68(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG67(s,f,__VA_ARGS__)) s f(67,t)
|
||||
#define STRUCT_PACK_DOARG69(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG68(s,f,__VA_ARGS__)) s f(68,t)
|
||||
#define STRUCT_PACK_DOARG70(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG69(s,f,__VA_ARGS__)) s f(69,t)
|
||||
#define STRUCT_PACK_DOARG71(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG70(s,f,__VA_ARGS__)) s f(70,t)
|
||||
#define STRUCT_PACK_DOARG72(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG71(s,f,__VA_ARGS__)) s f(71,t)
|
||||
#define STRUCT_PACK_DOARG73(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG72(s,f,__VA_ARGS__)) s f(72,t)
|
||||
#define STRUCT_PACK_DOARG74(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG73(s,f,__VA_ARGS__)) s f(73,t)
|
||||
#define STRUCT_PACK_DOARG75(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG74(s,f,__VA_ARGS__)) s f(74,t)
|
||||
#define STRUCT_PACK_DOARG76(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG75(s,f,__VA_ARGS__)) s f(75,t)
|
||||
#define STRUCT_PACK_DOARG77(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG76(s,f,__VA_ARGS__)) s f(76,t)
|
||||
#define STRUCT_PACK_DOARG78(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG77(s,f,__VA_ARGS__)) s f(77,t)
|
||||
#define STRUCT_PACK_DOARG79(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG78(s,f,__VA_ARGS__)) s f(78,t)
|
||||
#define STRUCT_PACK_DOARG80(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG79(s,f,__VA_ARGS__)) s f(79,t)
|
||||
#define STRUCT_PACK_DOARG81(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG80(s,f,__VA_ARGS__)) s f(80,t)
|
||||
#define STRUCT_PACK_DOARG82(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG81(s,f,__VA_ARGS__)) s f(81,t)
|
||||
#define STRUCT_PACK_DOARG83(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG82(s,f,__VA_ARGS__)) s f(82,t)
|
||||
#define STRUCT_PACK_DOARG84(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG83(s,f,__VA_ARGS__)) s f(83,t)
|
||||
#define STRUCT_PACK_DOARG85(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG84(s,f,__VA_ARGS__)) s f(84,t)
|
||||
#define STRUCT_PACK_DOARG86(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG85(s,f,__VA_ARGS__)) s f(85,t)
|
||||
#define STRUCT_PACK_DOARG87(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG86(s,f,__VA_ARGS__)) s f(86,t)
|
||||
#define STRUCT_PACK_DOARG88(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG87(s,f,__VA_ARGS__)) s f(87,t)
|
||||
#define STRUCT_PACK_DOARG89(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG88(s,f,__VA_ARGS__)) s f(88,t)
|
||||
#define STRUCT_PACK_DOARG90(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG89(s,f,__VA_ARGS__)) s f(89,t)
|
||||
#define STRUCT_PACK_DOARG91(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG90(s,f,__VA_ARGS__)) s f(90,t)
|
||||
#define STRUCT_PACK_DOARG92(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG91(s,f,__VA_ARGS__)) s f(91,t)
|
||||
#define STRUCT_PACK_DOARG93(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG92(s,f,__VA_ARGS__)) s f(92,t)
|
||||
#define STRUCT_PACK_DOARG94(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG93(s,f,__VA_ARGS__)) s f(93,t)
|
||||
#define STRUCT_PACK_DOARG95(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG94(s,f,__VA_ARGS__)) s f(94,t)
|
||||
#define STRUCT_PACK_DOARG96(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG95(s,f,__VA_ARGS__)) s f(95,t)
|
||||
#define STRUCT_PACK_DOARG97(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG96(s,f,__VA_ARGS__)) s f(96,t)
|
||||
#define STRUCT_PACK_DOARG98(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG97(s,f,__VA_ARGS__)) s f(97,t)
|
||||
#define STRUCT_PACK_DOARG99(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG98(s,f,__VA_ARGS__)) s f(98,t)
|
||||
#define STRUCT_PACK_DOARG100(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG99(s,f,__VA_ARGS__)) s f(99,t)
|
||||
#define STRUCT_PACK_DOARG101(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG100(s,f,__VA_ARGS__)) s f(100,t)
|
||||
#define STRUCT_PACK_DOARG102(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG101(s,f,__VA_ARGS__)) s f(101,t)
|
||||
#define STRUCT_PACK_DOARG103(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG102(s,f,__VA_ARGS__)) s f(102,t)
|
||||
#define STRUCT_PACK_DOARG104(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG103(s,f,__VA_ARGS__)) s f(103,t)
|
||||
#define STRUCT_PACK_DOARG105(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG104(s,f,__VA_ARGS__)) s f(104,t)
|
||||
#define STRUCT_PACK_DOARG106(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG105(s,f,__VA_ARGS__)) s f(105,t)
|
||||
#define STRUCT_PACK_DOARG107(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG106(s,f,__VA_ARGS__)) s f(106,t)
|
||||
#define STRUCT_PACK_DOARG108(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG107(s,f,__VA_ARGS__)) s f(107,t)
|
||||
#define STRUCT_PACK_DOARG109(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG108(s,f,__VA_ARGS__)) s f(108,t)
|
||||
#define STRUCT_PACK_DOARG110(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG109(s,f,__VA_ARGS__)) s f(109,t)
|
||||
#define STRUCT_PACK_DOARG111(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG110(s,f,__VA_ARGS__)) s f(110,t)
|
||||
#define STRUCT_PACK_DOARG112(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG111(s,f,__VA_ARGS__)) s f(111,t)
|
||||
#define STRUCT_PACK_DOARG113(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG112(s,f,__VA_ARGS__)) s f(112,t)
|
||||
#define STRUCT_PACK_DOARG114(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG113(s,f,__VA_ARGS__)) s f(113,t)
|
||||
#define STRUCT_PACK_DOARG115(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG114(s,f,__VA_ARGS__)) s f(114,t)
|
||||
#define STRUCT_PACK_DOARG116(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG115(s,f,__VA_ARGS__)) s f(115,t)
|
||||
#define STRUCT_PACK_DOARG117(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG116(s,f,__VA_ARGS__)) s f(116,t)
|
||||
#define STRUCT_PACK_DOARG118(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG117(s,f,__VA_ARGS__)) s f(117,t)
|
||||
#define STRUCT_PACK_DOARG119(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG118(s,f,__VA_ARGS__)) s f(118,t)
|
||||
#define STRUCT_PACK_DOARG120(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG119(s,f,__VA_ARGS__)) s f(119,t)
|
||||
#define STRUCT_PACK_DOARG121(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG120(s,f,__VA_ARGS__)) s f(120,t)
|
||||
#define STRUCT_PACK_DOARG122(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG121(s,f,__VA_ARGS__)) s f(121,t)
|
||||
#define STRUCT_PACK_DOARG123(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG122(s,f,__VA_ARGS__)) s f(122,t)
|
||||
#define STRUCT_PACK_DOARG124(s,f,t,...) STRUCT_PACK_MARCO_EXPAND(STRUCT_PACK_DOARG123(s,f,__VA_ARGS__)) s f(123,t)
|
||||
|
||||
#define STRUCT_PACK_MAKE_ARGS0(Type)
|
||||
#define STRUCT_PACK_MAKE_ARGS1(Type) Type
|
||||
|
@ -169,7 +216,66 @@
|
|||
#define STRUCT_PACK_MAKE_ARGS62(Type) STRUCT_PACK_MAKE_ARGS61(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS63(Type) STRUCT_PACK_MAKE_ARGS62(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS64(Type) STRUCT_PACK_MAKE_ARGS63(Type), Type
|
||||
|
||||
#define STRUCT_PACK_MAKE_ARGS65(Type) STRUCT_PACK_MAKE_ARGS64(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS66(Type) STRUCT_PACK_MAKE_ARGS65(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS67(Type) STRUCT_PACK_MAKE_ARGS66(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS68(Type) STRUCT_PACK_MAKE_ARGS67(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS69(Type) STRUCT_PACK_MAKE_ARGS68(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS70(Type) STRUCT_PACK_MAKE_ARGS69(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS71(Type) STRUCT_PACK_MAKE_ARGS70(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS72(Type) STRUCT_PACK_MAKE_ARGS71(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS73(Type) STRUCT_PACK_MAKE_ARGS72(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS74(Type) STRUCT_PACK_MAKE_ARGS73(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS75(Type) STRUCT_PACK_MAKE_ARGS74(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS76(Type) STRUCT_PACK_MAKE_ARGS75(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS77(Type) STRUCT_PACK_MAKE_ARGS76(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS78(Type) STRUCT_PACK_MAKE_ARGS77(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS79(Type) STRUCT_PACK_MAKE_ARGS78(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS80(Type) STRUCT_PACK_MAKE_ARGS79(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS81(Type) STRUCT_PACK_MAKE_ARGS80(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS82(Type) STRUCT_PACK_MAKE_ARGS81(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS83(Type) STRUCT_PACK_MAKE_ARGS82(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS84(Type) STRUCT_PACK_MAKE_ARGS83(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS85(Type) STRUCT_PACK_MAKE_ARGS84(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS86(Type) STRUCT_PACK_MAKE_ARGS85(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS87(Type) STRUCT_PACK_MAKE_ARGS86(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS88(Type) STRUCT_PACK_MAKE_ARGS87(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS89(Type) STRUCT_PACK_MAKE_ARGS88(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS90(Type) STRUCT_PACK_MAKE_ARGS89(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS91(Type) STRUCT_PACK_MAKE_ARGS90(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS92(Type) STRUCT_PACK_MAKE_ARGS91(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS93(Type) STRUCT_PACK_MAKE_ARGS92(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS94(Type) STRUCT_PACK_MAKE_ARGS93(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS95(Type) STRUCT_PACK_MAKE_ARGS94(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS96(Type) STRUCT_PACK_MAKE_ARGS95(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS97(Type) STRUCT_PACK_MAKE_ARGS96(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS98(Type) STRUCT_PACK_MAKE_ARGS97(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS99(Type) STRUCT_PACK_MAKE_ARGS98(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS100(Type) STRUCT_PACK_MAKE_ARGS99(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS101(Type) STRUCT_PACK_MAKE_ARGS100(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS102(Type) STRUCT_PACK_MAKE_ARGS101(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS103(Type) STRUCT_PACK_MAKE_ARGS102(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS104(Type) STRUCT_PACK_MAKE_ARGS103(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS105(Type) STRUCT_PACK_MAKE_ARGS104(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS106(Type) STRUCT_PACK_MAKE_ARGS105(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS107(Type) STRUCT_PACK_MAKE_ARGS106(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS108(Type) STRUCT_PACK_MAKE_ARGS107(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS109(Type) STRUCT_PACK_MAKE_ARGS108(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS110(Type) STRUCT_PACK_MAKE_ARGS109(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS111(Type) STRUCT_PACK_MAKE_ARGS110(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS112(Type) STRUCT_PACK_MAKE_ARGS111(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS113(Type) STRUCT_PACK_MAKE_ARGS112(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS114(Type) STRUCT_PACK_MAKE_ARGS113(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS115(Type) STRUCT_PACK_MAKE_ARGS114(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS116(Type) STRUCT_PACK_MAKE_ARGS115(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS117(Type) STRUCT_PACK_MAKE_ARGS116(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS118(Type) STRUCT_PACK_MAKE_ARGS117(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS119(Type) STRUCT_PACK_MAKE_ARGS118(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS120(Type) STRUCT_PACK_MAKE_ARGS119(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS121(Type) STRUCT_PACK_MAKE_ARGS120(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS122(Type) STRUCT_PACK_MAKE_ARGS121(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS123(Type) STRUCT_PACK_MAKE_ARGS122(Type), Type
|
||||
#define STRUCT_PACK_MAKE_ARGS124(Type) STRUCT_PACK_MAKE_ARGS123(Type), Type
|
||||
|
||||
#define STRUCT_PACK_MAKE_ARGS(Type,Count) \
|
||||
STRUCT_PACK_CONCAT(STRUCT_PACK_MAKE_ARGS,Count)(Type)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,278 @@
|
|||
#include <string>
|
||||
|
||||
#include "doctest.h"
|
||||
#include "ylt/struct_pack.hpp"
|
||||
#include "ylt/struct_pack/type_calculate.hpp"
|
||||
struct many_members {
|
||||
int a1;
|
||||
std::string b1;
|
||||
int a2;
|
||||
std::string b2;
|
||||
int a3;
|
||||
std::string b3;
|
||||
int a4;
|
||||
std::string b4;
|
||||
int a5;
|
||||
std::string b5;
|
||||
int a6;
|
||||
std::string b6;
|
||||
int a7;
|
||||
std::string b7;
|
||||
int a8;
|
||||
std::string b8;
|
||||
int a9;
|
||||
std::string b9;
|
||||
int a10;
|
||||
std::string b10;
|
||||
int a11;
|
||||
std::string b11;
|
||||
int a12;
|
||||
std::string b12;
|
||||
int a13;
|
||||
std::string b13;
|
||||
int a14;
|
||||
std::string b14;
|
||||
int a15;
|
||||
std::string b15;
|
||||
int a16;
|
||||
std::string b16;
|
||||
int a17;
|
||||
std::string b17;
|
||||
int a18;
|
||||
std::string b18;
|
||||
int a19;
|
||||
std::string b19;
|
||||
int a20;
|
||||
std::string b20;
|
||||
int a21;
|
||||
std::string b21;
|
||||
int a22;
|
||||
std::string b22;
|
||||
int a23;
|
||||
std::string b23;
|
||||
int a24;
|
||||
std::string b24;
|
||||
int a25;
|
||||
std::string b25;
|
||||
int a26;
|
||||
std::string b26;
|
||||
int a27;
|
||||
std::string b27;
|
||||
int a28;
|
||||
std::string b28;
|
||||
int a29;
|
||||
std::string b29;
|
||||
int a30;
|
||||
std::string b30;
|
||||
int a31;
|
||||
std::string b31;
|
||||
int a32;
|
||||
std::string b32;
|
||||
int a33;
|
||||
std::string b33;
|
||||
int a34;
|
||||
std::string b34;
|
||||
int a35;
|
||||
std::string b35;
|
||||
int a36;
|
||||
std::string b36;
|
||||
int a37;
|
||||
std::string b37;
|
||||
int a38;
|
||||
std::string b38;
|
||||
int a39;
|
||||
std::string b39;
|
||||
int a40;
|
||||
std::string b40;
|
||||
int a41;
|
||||
std::string b41;
|
||||
int a42;
|
||||
std::string b42;
|
||||
int a43;
|
||||
std::string b43;
|
||||
int a44;
|
||||
std::string b44;
|
||||
int a45;
|
||||
std::string b45;
|
||||
int a46;
|
||||
std::string b46;
|
||||
int a47;
|
||||
std::string b47;
|
||||
int a48;
|
||||
std::string b48;
|
||||
int a49;
|
||||
std::string b49;
|
||||
int a50;
|
||||
std::string b50;
|
||||
int a51;
|
||||
std::string b51;
|
||||
int a52;
|
||||
std::string b52;
|
||||
int a53;
|
||||
std::string b53;
|
||||
int a54;
|
||||
std::string b54;
|
||||
int a55;
|
||||
std::string b55;
|
||||
int a56;
|
||||
std::string b56;
|
||||
int a57;
|
||||
std::string b57;
|
||||
int a58;
|
||||
std::string b58;
|
||||
int a59;
|
||||
std::string b59;
|
||||
int a60;
|
||||
std::string b60;
|
||||
int a61;
|
||||
std::string b61;
|
||||
int a62;
|
||||
std::string b62;
|
||||
int a63;
|
||||
std::string b63;
|
||||
int a64;
|
||||
std::string b64;
|
||||
int a65;
|
||||
std::string b65;
|
||||
int a66;
|
||||
std::string b66;
|
||||
int a67;
|
||||
std::string b67;
|
||||
int a68;
|
||||
std::string b68;
|
||||
int a69;
|
||||
std::string b69;
|
||||
int a70;
|
||||
std::string b70;
|
||||
int a71;
|
||||
std::string b71;
|
||||
int a72;
|
||||
std::string b72;
|
||||
int a73;
|
||||
std::string b73;
|
||||
int a74;
|
||||
std::string b74;
|
||||
int a75;
|
||||
std::string b75;
|
||||
int a76;
|
||||
std::string b76;
|
||||
int a77;
|
||||
std::string b77;
|
||||
int a78;
|
||||
std::string b78;
|
||||
int a79;
|
||||
std::string b79;
|
||||
int a80;
|
||||
std::string b80;
|
||||
int a81;
|
||||
std::string b81;
|
||||
int a82;
|
||||
std::string b82;
|
||||
int a83;
|
||||
std::string b83;
|
||||
int a84;
|
||||
std::string b84;
|
||||
int a85;
|
||||
std::string b85;
|
||||
int a86;
|
||||
std::string b86;
|
||||
int a87;
|
||||
std::string b87;
|
||||
int a88;
|
||||
std::string b88;
|
||||
int a89;
|
||||
std::string b89;
|
||||
int a90;
|
||||
std::string b90;
|
||||
int a91;
|
||||
std::string b91;
|
||||
int a92;
|
||||
std::string b92;
|
||||
int a93;
|
||||
std::string b93;
|
||||
int a94;
|
||||
std::string b94;
|
||||
int a95;
|
||||
std::string b95;
|
||||
int a96;
|
||||
std::string b96;
|
||||
int a97;
|
||||
std::string b97;
|
||||
int a98;
|
||||
std::string b98;
|
||||
int a99;
|
||||
std::string b99;
|
||||
int a100;
|
||||
std::string b100;
|
||||
int a101;
|
||||
std::string b101;
|
||||
int a102;
|
||||
std::string b102;
|
||||
int a103;
|
||||
std::string b103;
|
||||
int a104;
|
||||
std::string b104;
|
||||
int a105;
|
||||
std::string b105;
|
||||
int a106;
|
||||
std::string b106;
|
||||
int a107;
|
||||
std::string b107;
|
||||
int a108;
|
||||
std::string b108;
|
||||
int a109;
|
||||
std::string b109;
|
||||
int a110;
|
||||
std::string b110;
|
||||
int a111;
|
||||
std::string b111;
|
||||
int a112;
|
||||
std::string b112;
|
||||
int a113;
|
||||
std::string b113;
|
||||
int a114;
|
||||
std::string b114;
|
||||
int a115;
|
||||
std::string b115;
|
||||
int a116;
|
||||
std::string b116;
|
||||
int a117;
|
||||
std::string b117;
|
||||
int a118;
|
||||
std::string b118;
|
||||
int a119;
|
||||
std::string b119;
|
||||
int a120;
|
||||
std::string b120;
|
||||
int a121;
|
||||
std::string b121;
|
||||
int a122;
|
||||
std::string b122;
|
||||
int a123;
|
||||
std::string b123;
|
||||
int a124;
|
||||
std::string b124;
|
||||
int a125;
|
||||
std::string b125;
|
||||
int a126;
|
||||
std::string b126;
|
||||
int a127;
|
||||
std::string b127;
|
||||
int a128;
|
||||
};
|
||||
struct many_members2 : public many_members {};
|
||||
STRUCT_PACK_REFL(many_members2, a1, b1, a2, b2, a3, b3, a4, b4, a5, b5, a6, b6,
|
||||
a7, b7, a8, b8, a9, b9, a10, b10, a11, b11, a12, b12, a13, b13,
|
||||
a14, b14, a15, b15, a16, b16, a17, b17, a18, b18, a19, b19,
|
||||
a20, b20, a21, b21, a22, b22, a23, b23, a24, b24, a25, b25,
|
||||
a26, b26, a27, b27, a28, b28, a29, b29, a30, b30, a31, b31,
|
||||
a32, b32, a33, b33, a34, b34, a35, b35, a36, b36, a37, b37,
|
||||
a38, b38, a39, b39, a40, b40, a41, b41, a42, b42, a43, b43,
|
||||
a44, b44, a45, b45, a46, b46, a47, b47, a48, b48, a49, b49,
|
||||
a50, b50, a51, b51, a52, b52, a53, b53, a54, b54, a55, b55,
|
||||
a56, b56, a57, b57, a58, b58, a59, b59, a60, b60, a61, b61,
|
||||
a62, b62);
|
||||
TEST_CASE("test many members") {
|
||||
CHECK(struct_pack::get_type_literal<many_members>().size() == 384);
|
||||
CHECK(struct_pack::get_type_literal<many_members2>().size() == 188);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
string i1 = "else if constexpr (Count == ";
|
||||
string j = " ){ return visitor(";
|
||||
string l = ");}";
|
||||
int main() {
|
||||
std::string list = "_SPG0(o)";
|
||||
for (int i = 2; i <= 256; ++i) {
|
||||
list += ",_SPG" + to_string(i - 1) + "(o)";
|
||||
cout << i1 + to_string(i) + j + list + l << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -274,7 +274,7 @@ This means if your RPC functions will block the current thread (e.g., thread sle
|
|||
|
||||
## Parameter and Return Value Types
|
||||
|
||||
coro_rpc allows users to register rpc functions with multiple parameters (up to 64), and the types of arguments and return values can be user-defined aggregate structures. They also support various data structures provided by the C++ standard library and many third-party libraries. For details, see: [struct_pack type system](https://alibaba.github.io/yalantinglibs/en/struct_pack/struct_pack_type_system.html)
|
||||
coro_rpc allows users to register rpc functions with multiple parameters (up to 255), and the types of arguments and return values can be user-defined aggregate structures. They also support various data structures provided by the C++ standard library and many third-party libraries. For details, see: [struct_pack type system](https://alibaba.github.io/yalantinglibs/en/struct_pack/struct_pack_type_system.html)
|
||||
|
||||
If your rpc argument or return value type is not supported by the struct_pack type system, we also allow users to register their own structures or custom serialization algorithms. For more details, see: [Custom feature](https://alibaba.github.io/yalantinglibs/en/struct_pack/struct_pack_intro.html#custom-type)
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ The class needs to provide: `size()`,`flip()`,`set()`,`reset()`,`count()`,and th
|
|||
|
||||
## Struct
|
||||
|
||||
`struct_pack` supports `struct` type. Up to **64** fields are supported and nested fields are supported too. All members
|
||||
`struct_pack` supports `struct` type. Up to **255** fields are supported and nested fields are supported too. All members
|
||||
should be of valid `struct_pack` type.
|
||||
|
||||
struct type could be `struct/class/std::tuple/tuplet::tuple/std::pair`
|
||||
|
|
|
@ -272,7 +272,7 @@ rpc错误码是一个16位的无符号整数。其中,0-255是保留给rpc框
|
|||
|
||||
## 参数与返回值类型
|
||||
|
||||
coro_rpc允许用户注册的rpc函数具有多个参数(最多64个),参数和返回值的类型可以是用户自定义的聚合结构体,也支持了各种c++标准库提供的数据结构和许多第三方库提供的数据结构。详见:[struct_pack的类型系统](https://alibaba.github.io/yalantinglibs/zh/struct_pack/struct_pack_type_system.html)
|
||||
coro_rpc允许用户注册的rpc函数具有多个参数(最多255个),参数和返回值的类型可以是用户自定义的聚合结构体,也支持了各种c++标准库提供的数据结构和许多第三方库提供的数据结构。详见:[struct_pack的类型系统](https://alibaba.github.io/yalantinglibs/zh/struct_pack/struct_pack_type_system.html)
|
||||
|
||||
如果你的rpc参数或返回值类型不属于struct_pack的类型系统支持的类型,我们也允许用户注册自己的结构体或者自定义序列化算法,详见:[自定义功能支持](https://alibaba.github.io/yalantinglibs/zh/struct_pack/struct_pack_intro.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%BA%8F%E5%88%97%E5%8C%96)
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ concept unique_ptr = requires(Type ptr) {
|
|||
|
||||
## 结构体
|
||||
|
||||
struct_pack支持结构体类型。结构体内可以包含最多64个字段,并允许结构体嵌套。结构体中的任何成员都必须是struct_pack的合法类型。
|
||||
struct_pack支持结构体类型。结构体内可以包含最多255个字段,并允许结构体嵌套。结构体中的任何成员都必须是struct_pack的合法类型。
|
||||
|
||||
struct_pack的结构体类型可以为:struct/class/std::pair/tuplet::tuple/std::tuple
|
||||
|
||||
|
|
Loading…
Reference in New Issue