@@ -411,6 +411,96 @@ class HAZELCAST_API compact_reader
411
411
boost::optional<double > read_nullable_float64 (
412
412
const std::string& field_name);
413
413
414
+ /* *
415
+ * Reads a nullable array of nullable booleans.
416
+ *
417
+ * @param field_name name of the field.
418
+ * @return the value of the field.
419
+ * @throws hazelcast_serialization if the field does not exist in the
420
+ * schema or the type of the field does not match with the one defined
421
+ * in the schema.
422
+ */
423
+ boost::optional<std::vector<boost::optional<bool >>>
424
+ read_array_of_nullable_boolean (const std::string& field_name);
425
+
426
+ /* *
427
+ * Reads a nullable array of nullable 8-bit two's complement signed
428
+ * integers.
429
+ *
430
+ * @param field_name name of the field.
431
+ * @return the value of the field.
432
+ * @throws hazelcast_serialization if the field does not exist in the
433
+ * schema or the type of the field does not match with the one defined
434
+ * in the schema.
435
+ */
436
+ boost::optional<std::vector<boost::optional<int8_t >>>
437
+ read_array_of_nullable_int8 (const std::string& field_name);
438
+
439
+ /* *
440
+ * Reads a nullable array of nullable 16-bit two's complement signed
441
+ * integers.
442
+ *
443
+ * @param field_name name of the field.
444
+ * @return the value of the field.
445
+ * @throws hazelcast_serialization if the field does not exist in the
446
+ * schema or the type of the field does not match with the one defined
447
+ * in the schema.
448
+ */
449
+ boost::optional<std::vector<boost::optional<int16_t >>>
450
+ read_array_of_nullable_int16 (const std::string& field_name);
451
+
452
+ /* *
453
+ * Reads a nullable array of nullable 32-bit two's complement signed
454
+ * integers.
455
+ *
456
+ * @param field_name name of the field.
457
+ * @return the value of the field.
458
+ * @throws hazelcast_serialization if the field does not exist in the
459
+ * schema or the type of the field does not match with the one defined
460
+ * in the schema.
461
+ */
462
+ boost::optional<std::vector<boost::optional<int32_t >>>
463
+ read_array_of_nullable_int32 (const std::string& field_name);
464
+
465
+ /* *
466
+ * Reads a nullable array of nullable 64-bit two's complement signed
467
+ * integers.
468
+ *
469
+ * @param field_name name of the field.
470
+ * @return the value of the field.
471
+ * @throws hazelcast_serialization if the field does not exist in the
472
+ * schema or the type of the field does not match with the one defined
473
+ * in the schema.
474
+ */
475
+ boost::optional<std::vector<boost::optional<int64_t >>>
476
+ read_array_of_nullable_int64 (const std::string& field_name);
477
+
478
+ /* *
479
+ * Reads a nullable array of nullable 32-bit IEEE 754 floating point
480
+ * numbers.
481
+ *
482
+ * @param field_name name of the field.
483
+ * @return the value of the field.
484
+ * @throws hazelcast_serialization if the field does not exist in the
485
+ * schema or the type of the field does not match with the one defined
486
+ * in the schema.
487
+ */
488
+ boost::optional<std::vector<boost::optional<float >>>
489
+ read_array_of_nullable_float32 (const std::string& field_name);
490
+
491
+ /* *
492
+ * Reads a nullable array of nullable 64-bit IEEE 754 floating point
493
+ * numbers.
494
+ *
495
+ * @param field_name name of the field.
496
+ * @return the value of the field.
497
+ * @throws hazelcast_serialization if the field does not exist in the
498
+ * schema or the type of the field does not match with the one defined
499
+ * in the schema.
500
+ */
501
+ boost::optional<std::vector<boost::optional<double >>>
502
+ read_array_of_nullable_float64 (const std::string& field_name);
503
+
414
504
private:
415
505
compact_reader (pimpl::compact_stream_serializer& compact_stream_serializer,
416
506
object_data_input& object_data_input,
@@ -481,6 +571,12 @@ class HAZELCAST_API compact_reader
481
571
typename boost::optional<T>>::type
482
572
read ();
483
573
template <typename T>
574
+ typename std::enable_if<
575
+ std::is_same<std::vector<boost::optional<bool >>,
576
+ typename std::remove_cv<T>::type>::value,
577
+ typename boost::optional<T>>::type
578
+ read ();
579
+ template <typename T>
484
580
boost::optional<T> read_array_of_primitive (
485
581
const std::string& field_name,
486
582
enum pimpl::field_kind field_kind,
@@ -505,6 +601,15 @@ class HAZELCAST_API compact_reader
505
601
const std::string& field_name,
506
602
enum pimpl::field_kind field_kind,
507
603
enum pimpl::field_kind nullable_field_kind);
604
+ template <typename T>
605
+ boost::optional<std::vector<boost::optional<T>>> read_array_of_nullable (
606
+ const std::string& field_name,
607
+ enum pimpl::field_kind field_kind,
608
+ enum pimpl::field_kind nullable_field_kind);
609
+ template <typename T>
610
+ boost::optional<std::vector<boost::optional<T>>>
611
+ read_primitive_array_as_nullable_array (
612
+ const pimpl::field_descriptor& field_descriptor);
508
613
static std::function<
509
614
int32_t (serialization::object_data_input&, uint32_t , uint32_t )>
510
615
get_offset_reader (int32_t data_length);
@@ -578,39 +683,39 @@ class HAZELCAST_API compact_writer
578
683
* Writes a 32-bit two's complement signed integer.
579
684
*
580
685
* @param field_name name of the field.
581
- * @param value to be written.
686
+ * @param value to be written.
582
687
*/
583
688
void write_int32 (const std::string& field_name, int32_t value);
584
689
585
690
/* *
586
691
* Writes a 64-bit two's complement signed integer.
587
692
*
588
693
* @param field_name name of the field.
589
- * @param value to be written.
694
+ * @param value to be written.
590
695
*/
591
696
void write_int64 (const std::string& field_name, int64_t value);
592
697
593
698
/* *
594
699
* Writes a 32-bit IEEE 754 floating point number.
595
700
*
596
701
* @param field_name name of the field.
597
- * @param value to be written.
702
+ * @param value to be written.
598
703
*/
599
704
void write_float32 (const std::string& field_name, float value);
600
705
601
706
/* *
602
707
* Writes a 64-bit IEEE 754 floating point number.
603
708
*
604
709
* @param field_name name of the field.
605
- * @param value to be written.
710
+ * @param value to be written.
606
711
*/
607
712
void write_float64 (const std::string& field_name, double value);
608
713
609
714
/* *
610
715
* Writes an UTF-8 encoded string.
611
716
*
612
717
* @param field_name name of the field.
613
- * @param value to be written.
718
+ * @param value to be written.
614
719
*/
615
720
void write_string (const std::string& field_name,
616
721
const boost::optional<std::string>& value);
@@ -619,7 +724,7 @@ class HAZELCAST_API compact_writer
619
724
* Writes a nested compact object.
620
725
*
621
726
* @param field_name name of the field.
622
- * @param value to be written.
727
+ * @param value to be written.
623
728
*/
624
729
template <typename T>
625
730
void write_compact (const std::string& field_name,
@@ -629,7 +734,7 @@ class HAZELCAST_API compact_writer
629
734
* Writes an array of booleans.
630
735
*
631
736
* @param field_name name of the field.
632
- * @param value to be written.
737
+ * @param value to be written.
633
738
*/
634
739
void write_array_of_boolean (
635
740
const std::string& field_name,
@@ -639,7 +744,7 @@ class HAZELCAST_API compact_writer
639
744
* Writes an array of 8-bit two's complement signed integers.
640
745
*
641
746
* @param field_name name of the field.
642
- * @param value to be written.
747
+ * @param value to be written.
643
748
*/
644
749
void write_array_of_int8 (const std::string& field_name,
645
750
const boost::optional<std::vector<int8_t >>& value);
@@ -708,7 +813,7 @@ class HAZELCAST_API compact_writer
708
813
* Writes an array of nested compact objects.
709
814
*
710
815
* @param field_name name of the field.
711
- * @param value to be written.
816
+ * @param value to be written.
712
817
*/
713
818
template <typename T>
714
819
void write_array_of_compact (
@@ -719,7 +824,7 @@ class HAZELCAST_API compact_writer
719
824
* Writes a nullable boolean.
720
825
*
721
826
* @param field_name name of the field.
722
- * @param value to be written.
827
+ * @param value to be written.
723
828
*/
724
829
void write_nullable_boolean (const std::string& field_name,
725
830
const boost::optional<bool >& value);
@@ -728,7 +833,7 @@ class HAZELCAST_API compact_writer
728
833
* Writes a nullable 8-bit two's complement signed integer.
729
834
*
730
835
* @param field_name name of the field.
731
- * @param value to be written.
836
+ * @param value to be written.
732
837
*/
733
838
void write_nullable_int8 (const std::string& field_name,
734
839
const boost::optional<int8_t >& value);
@@ -737,7 +842,7 @@ class HAZELCAST_API compact_writer
737
842
* Writes a nullable 16-bit two's complement signed integer.
738
843
*
739
844
* @param field_name name of the field.
740
- * @param value to be written.
845
+ * @param value to be written.
741
846
*/
742
847
void write_nullable_int16 (const std::string& field_name,
743
848
const boost::optional<int16_t >& value);
@@ -746,7 +851,7 @@ class HAZELCAST_API compact_writer
746
851
* Writes a nullable 32-bit two's complement signed integer.
747
852
*
748
853
* @param field_name name of the field.
749
- * @param value to be written.
854
+ * @param value to be written.
750
855
*/
751
856
void write_nullable_int32 (const std::string& field_name,
752
857
const boost::optional<int32_t >& value);
@@ -755,7 +860,7 @@ class HAZELCAST_API compact_writer
755
860
* Writes a nullable 64-bit two's complement signed integer.
756
861
*
757
862
* @param field_name name of the field.
758
- * @param value to be written.
863
+ * @param value to be written.
759
864
*/
760
865
void write_nullable_int64 (const std::string& field_name,
761
866
const boost::optional<int64_t >& value);
@@ -764,7 +869,7 @@ class HAZELCAST_API compact_writer
764
869
* Writes a nullable 32-bit IEEE 754 floating point number.
765
870
*
766
871
* @param field_name name of the field.
767
- * @param value to be written.
872
+ * @param value to be written.
768
873
*/
769
874
void write_nullable_float32 (const std::string& field_name,
770
875
const boost::optional<float >& value);
@@ -773,11 +878,87 @@ class HAZELCAST_API compact_writer
773
878
* Writes a nullable 64-bit IEEE 754 floating point number.
774
879
*
775
880
* @param field_name name of the field.
776
- * @param value to be written.
881
+ * @param value to be written.
777
882
*/
778
883
void write_nullable_float64 (const std::string& field_name,
779
884
const boost::optional<double >& value);
780
885
886
+ /* *
887
+ * Writes a nullable array of nullable booleans.
888
+ *
889
+ * @param field_name name of the field.
890
+ * @param value to be written.
891
+ */
892
+ void write_array_of_nullable_boolean (
893
+ const std::string& field_name,
894
+ const boost::optional<std::vector<boost::optional<bool >>>& value);
895
+
896
+ /* *
897
+ * Writes a nullable array of nullable 8-bit two's complement signed
898
+ * integers.
899
+ *
900
+ * @param field_name name of the field.
901
+ * @param value to be written.
902
+ */
903
+ void write_array_of_nullable_int8 (
904
+ const std::string& field_name,
905
+ const boost::optional<std::vector<boost::optional<int8_t >>>& value);
906
+
907
+ /* *
908
+ * Writes a nullable array of nullable 16-bit two's complement signed
909
+ * integers.
910
+ *
911
+ * @param field_name name of the field.
912
+ * @param value to be written.
913
+ */
914
+ void write_array_of_nullable_int16 (
915
+ const std::string& field_name,
916
+ const boost::optional<std::vector<boost::optional<int16_t >>>& value);
917
+
918
+ /* *
919
+ * Writes a nullable array of nullable 32-bit two's complement signed
920
+ * integers.
921
+ *
922
+ * @param field_name name of the field.
923
+ * @param value to be written.
924
+ */
925
+ void write_array_of_nullable_int32 (
926
+ const std::string& field_name,
927
+ const boost::optional<std::vector<boost::optional<int32_t >>>& value);
928
+
929
+ /* *
930
+ * Writes a nullable array of nullable 64-bit two's complement signed
931
+ * integers.
932
+ *
933
+ * @param field_name name of the field.
934
+ * @param value to be written.
935
+ */
936
+ void write_array_of_nullable_int64 (
937
+ const std::string& field_name,
938
+ const boost::optional<std::vector<boost::optional<int64_t >>>& value);
939
+
940
+ /* *
941
+ * Writes a nullable array of nullable 32-bit IEEE 754 floating point
942
+ * numbers.
943
+ *
944
+ * @param field_name name of the field.
945
+ * @param value to be written.
946
+ */
947
+ void write_array_of_nullable_float32 (
948
+ const std::string& field_name,
949
+ const boost::optional<std::vector<boost::optional<float >>>& value);
950
+
951
+ /* *
952
+ * Writes a nullable array of nullable 64-bit IEEE 754 floating point
953
+ * numbers.
954
+ *
955
+ * @param field_name name of the field.
956
+ * @param value to be written.
957
+ */
958
+ void write_array_of_nullable_float64 (
959
+ const std::string& field_name,
960
+ const boost::optional<std::vector<boost::optional<double >>>& value);
961
+
781
962
private:
782
963
friend compact_writer pimpl::create_compact_writer (
783
964
pimpl::default_compact_writer* default_compact_writer);
@@ -870,6 +1051,27 @@ class HAZELCAST_API default_compact_writer
870
1051
const boost::optional<float >& value);
871
1052
void write_nullable_float64 (const std::string& field_name,
872
1053
const boost::optional<double >& value);
1054
+ void write_array_of_nullable_boolean (
1055
+ const std::string& field_name,
1056
+ const boost::optional<std::vector<boost::optional<bool >>>& value);
1057
+ void write_array_of_nullable_int8 (
1058
+ const std::string& field_name,
1059
+ const boost::optional<std::vector<boost::optional<int8_t >>>& value);
1060
+ void write_array_of_nullable_int16 (
1061
+ const std::string& field_name,
1062
+ const boost::optional<std::vector<boost::optional<int16_t >>>& value);
1063
+ void write_array_of_nullable_int32 (
1064
+ const std::string& field_name,
1065
+ const boost::optional<std::vector<boost::optional<int32_t >>>& value);
1066
+ void write_array_of_nullable_int64 (
1067
+ const std::string& field_name,
1068
+ const boost::optional<std::vector<boost::optional<int64_t >>>& value);
1069
+ void write_array_of_nullable_float32 (
1070
+ const std::string& field_name,
1071
+ const boost::optional<std::vector<boost::optional<float >>>& value);
1072
+ void write_array_of_nullable_float64 (
1073
+ const std::string& field_name,
1074
+ const boost::optional<std::vector<boost::optional<double >>>& value);
873
1075
void end ();
874
1076
875
1077
private:
0 commit comments