本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

530 lines
11KB

  1. package roaring
  2. // NOTE: THIS FILE WAS PRODUCED BY THE
  3. // MSGP CODE GENERATION TOOL (github.com/tinylib/msgp)
  4. // DO NOT EDIT
  5. import (
  6. "github.com/tinylib/msgp/msgp"
  7. )
  8. // DecodeMsg implements msgp.Decodable
  9. func (z *containerSerz) DecodeMsg(dc *msgp.Reader) (err error) {
  10. var field []byte
  11. _ = field
  12. var zxvk uint32
  13. zxvk, err = dc.ReadMapHeader()
  14. if err != nil {
  15. return
  16. }
  17. for zxvk > 0 {
  18. zxvk--
  19. field, err = dc.ReadMapKeyPtr()
  20. if err != nil {
  21. return
  22. }
  23. switch msgp.UnsafeString(field) {
  24. case "t":
  25. {
  26. var zbzg uint8
  27. zbzg, err = dc.ReadUint8()
  28. z.t = contype(zbzg)
  29. }
  30. if err != nil {
  31. return
  32. }
  33. case "r":
  34. err = z.r.DecodeMsg(dc)
  35. if err != nil {
  36. return
  37. }
  38. default:
  39. err = dc.Skip()
  40. if err != nil {
  41. return
  42. }
  43. }
  44. }
  45. return
  46. }
  47. // EncodeMsg implements msgp.Encodable
  48. func (z *containerSerz) EncodeMsg(en *msgp.Writer) (err error) {
  49. // map header, size 2
  50. // write "t"
  51. err = en.Append(0x82, 0xa1, 0x74)
  52. if err != nil {
  53. return err
  54. }
  55. err = en.WriteUint8(uint8(z.t))
  56. if err != nil {
  57. return
  58. }
  59. // write "r"
  60. err = en.Append(0xa1, 0x72)
  61. if err != nil {
  62. return err
  63. }
  64. err = z.r.EncodeMsg(en)
  65. if err != nil {
  66. return
  67. }
  68. return
  69. }
  70. // MarshalMsg implements msgp.Marshaler
  71. func (z *containerSerz) MarshalMsg(b []byte) (o []byte, err error) {
  72. o = msgp.Require(b, z.Msgsize())
  73. // map header, size 2
  74. // string "t"
  75. o = append(o, 0x82, 0xa1, 0x74)
  76. o = msgp.AppendUint8(o, uint8(z.t))
  77. // string "r"
  78. o = append(o, 0xa1, 0x72)
  79. o, err = z.r.MarshalMsg(o)
  80. if err != nil {
  81. return
  82. }
  83. return
  84. }
  85. // UnmarshalMsg implements msgp.Unmarshaler
  86. func (z *containerSerz) UnmarshalMsg(bts []byte) (o []byte, err error) {
  87. var field []byte
  88. _ = field
  89. var zbai uint32
  90. zbai, bts, err = msgp.ReadMapHeaderBytes(bts)
  91. if err != nil {
  92. return
  93. }
  94. for zbai > 0 {
  95. zbai--
  96. field, bts, err = msgp.ReadMapKeyZC(bts)
  97. if err != nil {
  98. return
  99. }
  100. switch msgp.UnsafeString(field) {
  101. case "t":
  102. {
  103. var zcmr uint8
  104. zcmr, bts, err = msgp.ReadUint8Bytes(bts)
  105. z.t = contype(zcmr)
  106. }
  107. if err != nil {
  108. return
  109. }
  110. case "r":
  111. bts, err = z.r.UnmarshalMsg(bts)
  112. if err != nil {
  113. return
  114. }
  115. default:
  116. bts, err = msgp.Skip(bts)
  117. if err != nil {
  118. return
  119. }
  120. }
  121. }
  122. o = bts
  123. return
  124. }
  125. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  126. func (z *containerSerz) Msgsize() (s int) {
  127. s = 1 + 2 + msgp.Uint8Size + 2 + z.r.Msgsize()
  128. return
  129. }
  130. // DecodeMsg implements msgp.Decodable
  131. func (z *contype) DecodeMsg(dc *msgp.Reader) (err error) {
  132. {
  133. var zajw uint8
  134. zajw, err = dc.ReadUint8()
  135. (*z) = contype(zajw)
  136. }
  137. if err != nil {
  138. return
  139. }
  140. return
  141. }
  142. // EncodeMsg implements msgp.Encodable
  143. func (z contype) EncodeMsg(en *msgp.Writer) (err error) {
  144. err = en.WriteUint8(uint8(z))
  145. if err != nil {
  146. return
  147. }
  148. return
  149. }
  150. // MarshalMsg implements msgp.Marshaler
  151. func (z contype) MarshalMsg(b []byte) (o []byte, err error) {
  152. o = msgp.Require(b, z.Msgsize())
  153. o = msgp.AppendUint8(o, uint8(z))
  154. return
  155. }
  156. // UnmarshalMsg implements msgp.Unmarshaler
  157. func (z *contype) UnmarshalMsg(bts []byte) (o []byte, err error) {
  158. {
  159. var zwht uint8
  160. zwht, bts, err = msgp.ReadUint8Bytes(bts)
  161. (*z) = contype(zwht)
  162. }
  163. if err != nil {
  164. return
  165. }
  166. o = bts
  167. return
  168. }
  169. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  170. func (z contype) Msgsize() (s int) {
  171. s = msgp.Uint8Size
  172. return
  173. }
  174. // DecodeMsg implements msgp.Decodable
  175. func (z *roaringArray) DecodeMsg(dc *msgp.Reader) (err error) {
  176. var field []byte
  177. _ = field
  178. var zlqf uint32
  179. zlqf, err = dc.ReadMapHeader()
  180. if err != nil {
  181. return
  182. }
  183. for zlqf > 0 {
  184. zlqf--
  185. field, err = dc.ReadMapKeyPtr()
  186. if err != nil {
  187. return
  188. }
  189. switch msgp.UnsafeString(field) {
  190. case "keys":
  191. var zdaf uint32
  192. zdaf, err = dc.ReadArrayHeader()
  193. if err != nil {
  194. return
  195. }
  196. if cap(z.keys) >= int(zdaf) {
  197. z.keys = (z.keys)[:zdaf]
  198. } else {
  199. z.keys = make([]uint16, zdaf)
  200. }
  201. for zhct := range z.keys {
  202. z.keys[zhct], err = dc.ReadUint16()
  203. if err != nil {
  204. return
  205. }
  206. }
  207. case "needCopyOnWrite":
  208. var zpks uint32
  209. zpks, err = dc.ReadArrayHeader()
  210. if err != nil {
  211. return
  212. }
  213. if cap(z.needCopyOnWrite) >= int(zpks) {
  214. z.needCopyOnWrite = (z.needCopyOnWrite)[:zpks]
  215. } else {
  216. z.needCopyOnWrite = make([]bool, zpks)
  217. }
  218. for zcua := range z.needCopyOnWrite {
  219. z.needCopyOnWrite[zcua], err = dc.ReadBool()
  220. if err != nil {
  221. return
  222. }
  223. }
  224. case "copyOnWrite":
  225. z.copyOnWrite, err = dc.ReadBool()
  226. if err != nil {
  227. return
  228. }
  229. case "conserz":
  230. var zjfb uint32
  231. zjfb, err = dc.ReadArrayHeader()
  232. if err != nil {
  233. return
  234. }
  235. if cap(z.conserz) >= int(zjfb) {
  236. z.conserz = (z.conserz)[:zjfb]
  237. } else {
  238. z.conserz = make([]containerSerz, zjfb)
  239. }
  240. for zxhx := range z.conserz {
  241. var zcxo uint32
  242. zcxo, err = dc.ReadMapHeader()
  243. if err != nil {
  244. return
  245. }
  246. for zcxo > 0 {
  247. zcxo--
  248. field, err = dc.ReadMapKeyPtr()
  249. if err != nil {
  250. return
  251. }
  252. switch msgp.UnsafeString(field) {
  253. case "t":
  254. {
  255. var zeff uint8
  256. zeff, err = dc.ReadUint8()
  257. z.conserz[zxhx].t = contype(zeff)
  258. }
  259. if err != nil {
  260. return
  261. }
  262. case "r":
  263. err = z.conserz[zxhx].r.DecodeMsg(dc)
  264. if err != nil {
  265. return
  266. }
  267. default:
  268. err = dc.Skip()
  269. if err != nil {
  270. return
  271. }
  272. }
  273. }
  274. }
  275. default:
  276. err = dc.Skip()
  277. if err != nil {
  278. return
  279. }
  280. }
  281. }
  282. return
  283. }
  284. // EncodeMsg implements msgp.Encodable
  285. func (z *roaringArray) EncodeMsg(en *msgp.Writer) (err error) {
  286. // map header, size 4
  287. // write "keys"
  288. err = en.Append(0x84, 0xa4, 0x6b, 0x65, 0x79, 0x73)
  289. if err != nil {
  290. return err
  291. }
  292. err = en.WriteArrayHeader(uint32(len(z.keys)))
  293. if err != nil {
  294. return
  295. }
  296. for zhct := range z.keys {
  297. err = en.WriteUint16(z.keys[zhct])
  298. if err != nil {
  299. return
  300. }
  301. }
  302. // write "needCopyOnWrite"
  303. err = en.Append(0xaf, 0x6e, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
  304. if err != nil {
  305. return err
  306. }
  307. err = en.WriteArrayHeader(uint32(len(z.needCopyOnWrite)))
  308. if err != nil {
  309. return
  310. }
  311. for zcua := range z.needCopyOnWrite {
  312. err = en.WriteBool(z.needCopyOnWrite[zcua])
  313. if err != nil {
  314. return
  315. }
  316. }
  317. // write "copyOnWrite"
  318. err = en.Append(0xab, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
  319. if err != nil {
  320. return err
  321. }
  322. err = en.WriteBool(z.copyOnWrite)
  323. if err != nil {
  324. return
  325. }
  326. // write "conserz"
  327. err = en.Append(0xa7, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x7a)
  328. if err != nil {
  329. return err
  330. }
  331. err = en.WriteArrayHeader(uint32(len(z.conserz)))
  332. if err != nil {
  333. return
  334. }
  335. for zxhx := range z.conserz {
  336. // map header, size 2
  337. // write "t"
  338. err = en.Append(0x82, 0xa1, 0x74)
  339. if err != nil {
  340. return err
  341. }
  342. err = en.WriteUint8(uint8(z.conserz[zxhx].t))
  343. if err != nil {
  344. return
  345. }
  346. // write "r"
  347. err = en.Append(0xa1, 0x72)
  348. if err != nil {
  349. return err
  350. }
  351. err = z.conserz[zxhx].r.EncodeMsg(en)
  352. if err != nil {
  353. return
  354. }
  355. }
  356. return
  357. }
  358. // MarshalMsg implements msgp.Marshaler
  359. func (z *roaringArray) MarshalMsg(b []byte) (o []byte, err error) {
  360. o = msgp.Require(b, z.Msgsize())
  361. // map header, size 4
  362. // string "keys"
  363. o = append(o, 0x84, 0xa4, 0x6b, 0x65, 0x79, 0x73)
  364. o = msgp.AppendArrayHeader(o, uint32(len(z.keys)))
  365. for zhct := range z.keys {
  366. o = msgp.AppendUint16(o, z.keys[zhct])
  367. }
  368. // string "needCopyOnWrite"
  369. o = append(o, 0xaf, 0x6e, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
  370. o = msgp.AppendArrayHeader(o, uint32(len(z.needCopyOnWrite)))
  371. for zcua := range z.needCopyOnWrite {
  372. o = msgp.AppendBool(o, z.needCopyOnWrite[zcua])
  373. }
  374. // string "copyOnWrite"
  375. o = append(o, 0xab, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
  376. o = msgp.AppendBool(o, z.copyOnWrite)
  377. // string "conserz"
  378. o = append(o, 0xa7, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x7a)
  379. o = msgp.AppendArrayHeader(o, uint32(len(z.conserz)))
  380. for zxhx := range z.conserz {
  381. // map header, size 2
  382. // string "t"
  383. o = append(o, 0x82, 0xa1, 0x74)
  384. o = msgp.AppendUint8(o, uint8(z.conserz[zxhx].t))
  385. // string "r"
  386. o = append(o, 0xa1, 0x72)
  387. o, err = z.conserz[zxhx].r.MarshalMsg(o)
  388. if err != nil {
  389. return
  390. }
  391. }
  392. return
  393. }
  394. // UnmarshalMsg implements msgp.Unmarshaler
  395. func (z *roaringArray) UnmarshalMsg(bts []byte) (o []byte, err error) {
  396. var field []byte
  397. _ = field
  398. var zrsw uint32
  399. zrsw, bts, err = msgp.ReadMapHeaderBytes(bts)
  400. if err != nil {
  401. return
  402. }
  403. for zrsw > 0 {
  404. zrsw--
  405. field, bts, err = msgp.ReadMapKeyZC(bts)
  406. if err != nil {
  407. return
  408. }
  409. switch msgp.UnsafeString(field) {
  410. case "keys":
  411. var zxpk uint32
  412. zxpk, bts, err = msgp.ReadArrayHeaderBytes(bts)
  413. if err != nil {
  414. return
  415. }
  416. if cap(z.keys) >= int(zxpk) {
  417. z.keys = (z.keys)[:zxpk]
  418. } else {
  419. z.keys = make([]uint16, zxpk)
  420. }
  421. for zhct := range z.keys {
  422. z.keys[zhct], bts, err = msgp.ReadUint16Bytes(bts)
  423. if err != nil {
  424. return
  425. }
  426. }
  427. case "needCopyOnWrite":
  428. var zdnj uint32
  429. zdnj, bts, err = msgp.ReadArrayHeaderBytes(bts)
  430. if err != nil {
  431. return
  432. }
  433. if cap(z.needCopyOnWrite) >= int(zdnj) {
  434. z.needCopyOnWrite = (z.needCopyOnWrite)[:zdnj]
  435. } else {
  436. z.needCopyOnWrite = make([]bool, zdnj)
  437. }
  438. for zcua := range z.needCopyOnWrite {
  439. z.needCopyOnWrite[zcua], bts, err = msgp.ReadBoolBytes(bts)
  440. if err != nil {
  441. return
  442. }
  443. }
  444. case "copyOnWrite":
  445. z.copyOnWrite, bts, err = msgp.ReadBoolBytes(bts)
  446. if err != nil {
  447. return
  448. }
  449. case "conserz":
  450. var zobc uint32
  451. zobc, bts, err = msgp.ReadArrayHeaderBytes(bts)
  452. if err != nil {
  453. return
  454. }
  455. if cap(z.conserz) >= int(zobc) {
  456. z.conserz = (z.conserz)[:zobc]
  457. } else {
  458. z.conserz = make([]containerSerz, zobc)
  459. }
  460. for zxhx := range z.conserz {
  461. var zsnv uint32
  462. zsnv, bts, err = msgp.ReadMapHeaderBytes(bts)
  463. if err != nil {
  464. return
  465. }
  466. for zsnv > 0 {
  467. zsnv--
  468. field, bts, err = msgp.ReadMapKeyZC(bts)
  469. if err != nil {
  470. return
  471. }
  472. switch msgp.UnsafeString(field) {
  473. case "t":
  474. {
  475. var zkgt uint8
  476. zkgt, bts, err = msgp.ReadUint8Bytes(bts)
  477. z.conserz[zxhx].t = contype(zkgt)
  478. }
  479. if err != nil {
  480. return
  481. }
  482. case "r":
  483. bts, err = z.conserz[zxhx].r.UnmarshalMsg(bts)
  484. if err != nil {
  485. return
  486. }
  487. default:
  488. bts, err = msgp.Skip(bts)
  489. if err != nil {
  490. return
  491. }
  492. }
  493. }
  494. }
  495. default:
  496. bts, err = msgp.Skip(bts)
  497. if err != nil {
  498. return
  499. }
  500. }
  501. }
  502. o = bts
  503. return
  504. }
  505. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  506. func (z *roaringArray) Msgsize() (s int) {
  507. s = 1 + 5 + msgp.ArrayHeaderSize + (len(z.keys) * (msgp.Uint16Size)) + 16 + msgp.ArrayHeaderSize + (len(z.needCopyOnWrite) * (msgp.BoolSize)) + 12 + msgp.BoolSize + 8 + msgp.ArrayHeaderSize
  508. for zxhx := range z.conserz {
  509. s += 1 + 2 + msgp.Uint8Size + 2 + z.conserz[zxhx].r.Msgsize()
  510. }
  511. return
  512. }
上海开阖软件有限公司 沪ICP备12045867号-1