27 #include <SimoxUtility/meta/type_name.h>
35 "std::vector<" + FromAronType(*e.getAcceptedType())->getFullInstantiatedCppTypename() +
">",
36 "std::vector<" + FromAronType(*e.getAcceptedType())->getFullInstantiatedCppTypename() +
">",
38 simox::meta::get_type_name<type::dto::
List>(), e)
46 return c->getRequiredIncludes();
51 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
52 block_if_data->addLine(cppAccessor +
nextEl() +
"clear();");
63 std::string nextVariantAccessor;
65 CppBlockPtr b2 = type_s->getWriteTypeBlock(type_s->getInstantiatedCppTypename(), cppAccessor +
nextEl() +
"accepted_type", nextPath, nextVariantAccessor);
68 b->addLine(
"auto " + variantAccessor +
" = " +
ARON_WRITER_ACCESSOR +
".writeList(" + nextVariantAccessor +
", " +
76 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
80 const std::string elementsAccessor = variantAccessor +
"_listElements";
81 block_if_data->addLine(
"std::vector<_Aron_T> " + elementsAccessor +
";");
86 block_if_data->addLine(
"for(unsigned int " + accessor_iterator +
" = 0; " + accessor_iterator +
" < " + cppAccessor +
nextEl() +
"size(); ++" + accessor_iterator +
")");
88 std::string nextVariantAccessor;
89 auto for_loop = std::make_shared<CppBlock>();
90 Path nextPath = p.
withElement(
"std::to_string(" + accessor_iterator +
")");
91 auto child_b = type_s->getWriteBlock(cppAccessor +
nextEl() +
"at(" + accessor_iterator +
")", nextPath, nextVariantAccessor);
92 for_loop->addLine(
"auto " + nextVariantAccessor +
" = " +
ARON_WRITER_ACCESSOR +
".writeNull();");
93 for_loop->appendBlock(child_b);
94 for_loop->addLine(elementsAccessor +
".push_back(" + nextVariantAccessor +
");");
95 block_if_data->addBlock(for_loop);
99 block_if_data->addLine(variantAccessor +
" = " +
ARON_WRITER_ACCESSOR +
".writeList(" + elementsAccessor +
", " +
107 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
109 std::string elements_accessor =
ARON_VARIABLE_PREFIX +
"_" + escaped_accessor +
"_listElements";
110 std::string accessor_iterator_value =
ARON_VARIABLE_PREFIX +
"_" + escaped_accessor +
"_listValue";
112 block_if_data->addLine(
"std::vector<_Aron_TNonConst> " + elements_accessor +
";");
113 block_if_data->addLine(
"" +
ARON_READER_ACCESSOR +
".readList(" + variantAccessor +
", " + elements_accessor +
");");
114 block_if_data->addLine(
"for (const auto& " + accessor_iterator_value +
" : " + elements_accessor +
")");
116 CppBlockPtr for_loop = std::make_shared<CppBlock>();
121 for_loop->addLine(type_s->getFullInstantiatedCppTypename() +
" " + accessor_iterator_tmp +
";");
122 for_loop->appendBlock(type_s->getReadBlock(accessor_iterator_tmp, accessor_iterator_value));
123 for_loop->addLine(cppAccessor +
nextEl() +
"push_back(" + accessor_iterator_tmp +
");");
124 block_if_data->addBlock(for_loop);