File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,11 @@ if(peekType_${recursionDepth}.has_value()){
166166 #end
167167#elseif($shapeMember.list)
168168 #set($template.nestedShapeMember = $shapeMember.listMember.shape)
169+ #if($shapeMember.sparse)
170+ auto nestedList_${recursionDepth} = Vector<Aws::Crt::Optional<$CppViewHelper.computeCppType($template.nestedShapeMember)>>();
171+ #else
169172 auto nestedList_${recursionDepth} = Vector<$CppViewHelper.computeCppType($template.nestedShapeMember)>();
173+ #end
170174 auto peekType_${recursionDepth} = decoder->PeekType();
171175 if (peekType_${recursionDepth}.has_value() && (peekType_${recursionDepth}.value() == CborType::ArrayStart || peekType_${recursionDepth}.value() == CborType::IndefArrayStart))
172176 {
@@ -213,7 +217,11 @@ if(peekType_${recursionDepth}.has_value()){
213217 }
214218#elseif($shapeMember.map)
215219 #set($template.nestedShapeMember = $shapeMember.mapValue.shape)
220+ #if($shapeMember.sparse)
221+ auto nestedMap_${recursionDepth} = Map<Aws::String, Aws::Crt::Optional<$CppViewHelper.computeCppType($template.nestedShapeMember)>>();
222+ #else
216223 auto nestedMap_${recursionDepth} = Map<Aws::String, $CppViewHelper.computeCppType($template.nestedShapeMember)>();
224+ #end
217225 auto peekType_${recursionDepth} = decoder->PeekType();
218226 if (peekType_${recursionDepth}.has_value() && (peekType_${recursionDepth}.value() == CborType::MapStart || peekType_${recursionDepth}.value() == CborType::IndefMapStart))
219227 {
Original file line number Diff line number Diff line change @@ -169,7 +169,11 @@ if(peekType_${recursionDepth}){
169169 #end
170170#elseif($shapeMember.map)
171171 #set($template.nestedShapeMember = $shapeMember.mapValue.shape)
172+ #if($shapeMember.sparse)
173+ auto nestedMap_${recursionDepth} = Map<Aws::String, Aws::Crt::Optional<$CppViewHelper.computeCppType($template.nestedShapeMember)>>();
174+ #else
172175 auto nestedMap_${recursionDepth} = Map<Aws::String, $CppViewHelper.computeCppType($template.nestedShapeMember)>();
176+ #end
173177 auto peekType_${recursionDepth} = decoder->PeekType();
174178 if (peekType_${recursionDepth}.has_value() && (peekType_${recursionDepth}.value() == CborType::MapStart || peekType_${recursionDepth}.value() == CborType::IndefMapStart))
175179 {
@@ -214,7 +218,11 @@ if(peekType_${recursionDepth}){
214218 }
215219#elseif($shapeMember.list)
216220 #set($template.nestedShapeMember = $shapeMember.listMember.shape)
221+ #if($shapeMember.sparse)
222+ auto nestedList_${recursionDepth} = Vector<Aws::Crt::Optional<$CppViewHelper.computeCppType($template.nestedShapeMember)>>();
223+ #else
217224 auto nestedList_${recursionDepth} = Vector<$CppViewHelper.computeCppType($template.nestedShapeMember)>();
225+ #end
218226 auto peekType_${recursionDepth} = decoder->PeekType();
219227 if (peekType_${recursionDepth}.has_value() && (peekType_${recursionDepth}.value() == CborType::ArrayStart || peekType_${recursionDepth}.value() == CborType::IndefArrayStart))
220228 {
Original file line number Diff line number Diff line change 1818#end
1919#if($template.recursionDepth > 1)
2020#set($template.containerVar = ${template.lowerCaseVarName} + "Map")
21+ #if($template.currentShape.sparse)
22+ ${template.currentSpaces}Aws::Map<${CppViewHelper.computeCppType($template.currentShape.mapKey.shape)}, Aws::Crt::Optional<${CppViewHelper.computeCppType($template.currentShape.mapValue.shape)}>> ${template.lowerCaseVarName}Map;
23+ #else
2124 ${template.currentSpaces}Aws::Map<${CppViewHelper.computeCppType($template.currentShape.mapKey.shape)}, ${CppViewHelper.computeCppType($template.currentShape.mapValue.shape)}> ${template.lowerCaseVarName}Map;
25+ #end
2226#end
2327 ${template.currentSpaces}for(auto& ${template.lowerCaseVarName}Item : ${template.lowerCaseVarName}JsonMap)
2428 ${template.currentSpaces}{
8488#end
8589#if($template.recursionDepth > 1)
8690#set($template.containerVar = ${template.lowerCaseVarName} + "List")
91+ #if($template.currentShape.sparse)
92+ ${template.currentSpaces}Aws::Vector<Aws::Crt::Optional<${CppViewHelper.computeCppType($template.currentShape.listMember.shape)}>> ${template.lowerCaseVarName}List;
93+ #else
8794 ${template.currentSpaces}Aws::Vector<${CppViewHelper.computeCppType($template.currentShape.listMember.shape)}> ${template.lowerCaseVarName}List;
95+ #end
8896 ${template.currentSpaces}${template.lowerCaseVarName}List.reserve((size_t)${template.lowerCaseVarName}JsonList.GetLength());
8997#end
9098 ${template.currentSpaces}for(unsigned ${template.lowerCaseVarName}Index = 0; ${template.lowerCaseVarName}Index < ${template.lowerCaseVarName}JsonList.GetLength(); ++${template.lowerCaseVarName}Index)
You can’t perform that action at this time.
0 commit comments