61 size_t current_element_count = 0;
62 std::function<void(
const typename DECODER::Element& element)> transform_value;
64 transform_value = std::function<void(const typename DECODER::Element& element)>(
65 [¤t_element_count, &encoder](
const typename DECODER::Element& element) {
66 uint64_t value_pointer = {};
68 element.getRawValue(&value_pointer,
sizeof(value_pointer));
69 encoder.setElementRawValue(encoder.resolve(current_element_count++),
71 sizeof(value_pointer));
75 transform_value = std::function<void(const typename DECODER::Element& element)>(
76 [¤t_element_count, &encoder](
const typename DECODER::Element& element) {
77 encoder.setElementVariantValue(encoder.resolve(current_element_count++),
78 element.getVariantValue());
83 std::string(
"Invalid transform_option given: " +
84 std::to_string(
static_cast<uint32_t
>(transform_option))).c_str());
89 [&transform_value, &encoder](
const auto& element) { transform_value(element); });
91 catch (
const std::exception& oException) {
a_util::result::Result transform(const DECODER &decoder, ENCODER &encoder, const TransformOption transform_option)
Definition serialization.h:57
void forEachLeafElement(ElementsType &elements, const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &func)
Iterates ALL leaf elements within ALL array elements.
Definition codec_iterator.h:1475