@@ -74,10 +74,12 @@ struct StoreElmBase {
74
74
*
75
75
* \param[in] dump_to_json whether to dump to JSON output
76
76
* \param[in] provide_to_lb whether to provide to the LB
77
+ * \param[in] dump_to_attributes whether to dump to attributes in JSON output
77
78
*/
78
- StoreElmBase (bool dump_to_json, bool provide_to_lb)
79
+ StoreElmBase (bool dump_to_json, bool provide_to_lb, bool dump_to_attributes )
79
80
: dump_to_json_(dump_to_json),
80
- provide_to_lb_ (provide_to_lb)
81
+ provide_to_lb_ (provide_to_lb),
82
+ dump_to_attributes_(dump_to_attributes)
81
83
{}
82
84
83
85
virtual ~StoreElmBase () {}
@@ -121,6 +123,7 @@ struct StoreElmBase {
121
123
void serialize (SerializerT& s) {
122
124
s | dump_to_json_;
123
125
s | provide_to_lb_;
126
+ s | dump_to_attributes_;
124
127
}
125
128
126
129
/* *
@@ -139,6 +142,15 @@ struct StoreElmBase {
139
142
return provide_to_lb_;
140
143
}
141
144
145
+ /* *
146
+ * \brief Whether the value should be dumped to the json attributes field
147
+ *
148
+ * \return whether it is an attribute
149
+ */
150
+ bool isAttribute () const {
151
+ return dump_to_attributes_;
152
+ }
153
+
142
154
/* *
143
155
* \brief Generate the json because it is jsonable
144
156
*
@@ -177,6 +189,7 @@ struct StoreElmBase {
177
189
protected:
178
190
bool dump_to_json_ = false ;
179
191
bool provide_to_lb_ = false ;
192
+ bool dump_to_attributes_ = false ;
180
193
};
181
194
182
195
/* *
@@ -209,10 +222,11 @@ struct StoreElm<
209
222
* \param[in] u the value
210
223
* \param[in] dump_to_json whether to dump to json
211
224
* \param[in] provide_to_lb whether to provide to LB
225
+ * \param[in] dump_to_attributes whether to dump to attributes in JSON output
212
226
*/
213
227
template <typename U>
214
- explicit StoreElm (U&& u, bool dump_to_json, bool provide_to_lb)
215
- : StoreElmBase(dump_to_json, provide_to_lb),
228
+ explicit StoreElm (U&& u, bool dump_to_json, bool provide_to_lb, bool dump_to_attributes )
229
+ : StoreElmBase(dump_to_json, provide_to_lb, dump_to_attributes ),
216
230
elm_(std::forward<U>(u))
217
231
{ }
218
232
@@ -328,10 +342,11 @@ struct StoreElm<
328
342
* \param[in] u the value
329
343
* \param[in] dump_to_json whether to dump to json
330
344
* \param[in] provide_to_lb whether to provide to LB
345
+ * \param[in] dump_to_attributes whether to dump to attributes in JSON output
331
346
*/
332
347
template <typename U>
333
- explicit StoreElm (U&& u, bool dump_to_json, bool provide_to_lb)
334
- : StoreElmBase(dump_to_json, provide_to_lb),
348
+ explicit StoreElm (U&& u, bool dump_to_json, bool provide_to_lb, bool dump_to_attributes )
349
+ : StoreElmBase(dump_to_json, provide_to_lb, dump_to_attributes ),
335
350
wrapper_(detail::ByteWrapper<T>{std::forward<U>(u)})
336
351
{ }
337
352
0 commit comments