27 #include <SimoxUtility/algorithm/vector.hpp>
28 #include <SimoxUtility/meta/type_name.h>
34 "std::pair<" + ExtractCppTypename(*e.getFirstAcceptedType()) +
", " +
35 ExtractCppTypename(*e.getSecondAcceptedType()) +
">",
36 "std::pair<" + ExtractCppTypename(*e.getFirstAcceptedType()) +
", " +
37 ExtractCppTypename(*e.getSecondAcceptedType()) +
">",
39 simox::meta::get_type_name<type::dto::
Pair>(),
44 std::vector<std::string>
50 auto l1 = child_s1->getRequiredIncludes();
51 auto l2 = child_s2->getRequiredIncludes();
53 return simox::alg::appended(l1, l2);
59 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
64 block_if_data->appendBlock(b21);
68 block_if_data->appendBlock(b22);
74 const std::string& cppAccessor,
76 std::string& variantAccessor)
const
78 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
83 std::string accessor_iterator1 = cppAccessor +
nextEl() +
"first";
84 std::string firstVariantAccessor;
86 CppBlockPtr b21 = child_s1->getWriteTypeBlock(child_s1->getInstantiatedCppTypename(),
89 firstVariantAccessor);
90 block_if_data->appendBlock(b21);
93 std::string accessor_iterator2 = cppAccessor +
nextEl() +
"second";
94 std::string secondVariantAccessor;
96 CppBlockPtr b22 = child_s2->getWriteTypeBlock(child_s2->getInstantiatedCppTypename(),
99 secondVariantAccessor);
100 block_if_data->appendBlock(b22);
103 ".writePair(" + firstVariantAccessor +
", " + secondVariantAccessor +
106 simox::alg::join(p.
getPath(),
", ") +
"})); // of " + cppAccessor);
107 return block_if_data;
113 std::string& variantAccessor)
const
115 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
120 std::string accessor_iterator1 = cppAccessor +
nextEl() +
"first";
121 std::string firstVariantAccessor;
124 child_s1->getWriteBlock(accessor_iterator1, firstPath, firstVariantAccessor);
127 block_if_data->appendBlock(b21);
130 std::string accessor_iterator2 = cppAccessor +
nextEl() +
"second";
131 std::string secondVariantAccessor;
134 child_s2->getWriteBlock(accessor_iterator2, secondPath, secondVariantAccessor);
137 block_if_data->appendBlock(b22);
140 firstVariantAccessor +
", " + secondVariantAccessor +
", " +
142 simox::alg::join(p.
getPath(),
", ") +
"})); // of " + cppAccessor);
149 CppBlockPtr block_if_data = std::make_shared<CppBlock>();
151 std::string elements_accessor =
154 block_if_data->addLine(
"std::vector<_Aron_TNonConst> " + elements_accessor +
";");
156 "); // of " + cppAccessor);
160 child_s1->getReadBlock(cppAccessor +
nextEl() +
"first", elements_accessor +
"[0]");
161 block_if_data->appendBlock(b21);
165 child_s2->getReadBlock(cppAccessor +
nextEl() +
"second", elements_accessor +
"[1]");
166 block_if_data->appendBlock(b22);