Commit 99ca831
committed
[C++] Port access order checking tests and implementation to C++.
In this commit, I also addressed these issues (1-3):
--- 1. Tidy up string format usage. ---
For convenience and readability, I had inlined some concatenation into
`string.format(...)` templates; however, this makes it unclear whether
the variable/method-output being concatenated uses template parameters.
Therefore, I have adjusted to inject these strings via template
parameters. FWIW I'd prefer to use `StringBuilder` everywhere, as I
think it is hard to read large string format templates.
--- 2. Explcitly delete copy constructors of flyweights. ---
I found it easy to accidentally write sub-optimal code where I relied on
copy constructors. For example:
```
MyMessage::MyGroup myGroup = myMessage.myGroup(10);
```
rather than:
```
MyMessage::MyGroup &myGroup = myMessage.myGroup(10);
```
Copying semantics are a bit strange when it comes to flyweights and
trees of flyweights. Therefore, I think it is best to avoid entirely.
This change is behind a feature flag. To re-enable implicit copy
constructors specify the system property
`-Dsbe.generate.implicit.copy.constructors=true`.
--- 3. Adjust state machines to allow repeated decoding of variable-length ---
data lengths, as accesses do not advance `limit`.1 parent 646abc3 commit 99ca831
File tree
13 files changed
+6619
-336
lines changed- csharp/sbe-tests
- sbe-tool/src
- main/java/uk/co/real_logic/sbe
- generation
- common
- cpp
- csharp
- java
- ir/generated
- test
- cpp
- java/uk/co/real_logic/sbe
13 files changed
+6619
-336
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
134 | 147 | | |
135 | 148 | | |
136 | 149 | | |
| |||
2806 | 2819 | | |
2807 | 2820 | | |
2808 | 2821 | | |
2809 | | - | |
| 2822 | + | |
| 2823 | + | |
2810 | 2824 | | |
2811 | 2825 | | |
2812 | 2826 | | |
| |||
2841 | 2855 | | |
2842 | 2856 | | |
2843 | 2857 | | |
2844 | | - | |
| 2858 | + | |
| 2859 | + | |
2845 | 2860 | | |
2846 | 2861 | | |
2847 | 2862 | | |
| |||
2878 | 2893 | | |
2879 | 2894 | | |
2880 | 2895 | | |
2881 | | - | |
| 2896 | + | |
| 2897 | + | |
2882 | 2898 | | |
2883 | 2899 | | |
2884 | 2900 | | |
| |||
2915 | 2931 | | |
2916 | 2932 | | |
2917 | 2933 | | |
2918 | | - | |
| 2934 | + | |
| 2935 | + | |
2919 | 2936 | | |
2920 | 2937 | | |
2921 | 2938 | | |
| |||
2949 | 2966 | | |
2950 | 2967 | | |
2951 | 2968 | | |
2952 | | - | |
| 2969 | + | |
| 2970 | + | |
2953 | 2971 | | |
2954 | 2972 | | |
2955 | 2973 | | |
| |||
2962 | 2980 | | |
2963 | 2981 | | |
2964 | 2982 | | |
2965 | | - | |
| 2983 | + | |
2966 | 2984 | | |
2967 | 2985 | | |
2968 | 2986 | | |
| |||
2973 | 2991 | | |
2974 | 2992 | | |
2975 | 2993 | | |
2976 | | - | |
| 2994 | + | |
2977 | 2995 | | |
2978 | 2996 | | |
2979 | 2997 | | |
| |||
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
| |||
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
139 | 157 | | |
140 | 158 | | |
141 | 159 | | |
| |||
541 | 559 | | |
542 | 560 | | |
543 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
544 | 568 | | |
545 | 569 | | |
546 | 570 | | |
| |||
635 | 659 | | |
636 | 660 | | |
637 | 661 | | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
638 | 671 | | |
639 | 672 | | |
640 | 673 | | |
| |||
902 | 935 | | |
903 | 936 | | |
904 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
905 | 974 | | |
906 | 975 | | |
907 | 976 | | |
| |||
915 | 984 | | |
916 | 985 | | |
917 | 986 | | |
| 987 | + | |
918 | 988 | | |
919 | 989 | | |
920 | 990 | | |
| |||
1029 | 1099 | | |
1030 | 1100 | | |
1031 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1032 | 1120 | | |
1033 | 1121 | | |
1034 | 1122 | | |
0 commit comments