MCPcopy Create free account
hub / github.com/chrxh/alien / loadSave

Function loadSave

source/PersisterInterface/SerializerService.cpp:216–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 }
215 template <typename T>
216 void loadSave(SerializationTask task, std::unordered_map<int, VariantData>& loadSaveMap, int key, T& value, T const& defaultValue)
217 {
218 if (task == SerializationTask::Load) {
219 auto findResult = loadSaveMap.find(key);
220 if (findResult != loadSaveMap.end()) {
221 auto variantData = findResult->second;
222 value = std::get<T>(variantData);
223 } else {
224 value = defaultValue;
225 }
226 } else {
227 loadSaveMap.emplace(key, value);
228 }
229 }
230 template <class Archive>
231 void processLoadSaveMap(SerializationTask task, Archive& ar, std::unordered_map<int, VariantData>& loadSaveMap)
232 {

Callers

nothing calls this directly

Calls 12

getLoadSaveMapFunction · 0.85
processLoadSaveMapFunction · 0.85
MakeGenomeCopyClass · 0.85
toIntFunction · 0.85
toFloatFunction · 0.85
findMethod · 0.80
endMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected