serialize.cc (11072:6a447a3138ef) | serialize.cc (11075:f959b7f89d4d) |
---|---|
1/* 2 * Copyright (c) 2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 209 unchanged lines hidden (view full) --- 218 string str; 219 if (!cp.find(section, name, str) || !parseParam(str, param)) { 220 fatal("Can't unserialize '%s:%s'\n", section, name); 221 } 222} 223 224template <class T> 225bool | 1/* 2 * Copyright (c) 2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 209 unchanged lines hidden (view full) --- 218 string str; 219 if (!cp.find(section, name, str) || !parseParam(str, param)) { 220 fatal("Can't unserialize '%s:%s'\n", section, name); 221 } 222} 223 224template <class T> 225bool |
226optParamIn(CheckpointIn &cp, const string &name, T ¶m) | 226optParamIn(CheckpointIn &cp, const string &name, T ¶m, bool warn) |
227{ 228 const string §ion(Serializable::currentSection()); 229 string str; 230 if (!cp.find(section, name, str) || !parseParam(str, param)) { | 227{ 228 const string §ion(Serializable::currentSection()); 229 string str; 230 if (!cp.find(section, name, str) || !parseParam(str, param)) { |
231 warn("optional parameter %s:%s not present\n", section, name); | 231 if (warn) 232 warn("optional parameter %s:%s not present\n", section, name); |
232 return false; 233 } else { 234 return true; 235 } 236} 237 238template <class T> 239void --- 139 unchanged lines hidden (view full) --- 379 380 381#define INSTANTIATE_PARAM_TEMPLATES(type) \ 382 template void \ 383 paramOut(CheckpointOut &os, const string &name, type const ¶m); \ 384 template void \ 385 paramIn(CheckpointIn &cp, const string &name, type & param); \ 386 template bool \ | 233 return false; 234 } else { 235 return true; 236 } 237} 238 239template <class T> 240void --- 139 unchanged lines hidden (view full) --- 380 381 382#define INSTANTIATE_PARAM_TEMPLATES(type) \ 383 template void \ 384 paramOut(CheckpointOut &os, const string &name, type const ¶m); \ 385 template void \ 386 paramIn(CheckpointIn &cp, const string &name, type & param); \ 387 template bool \ |
387 optParamIn(CheckpointIn &cp, const string &name, type & param); \ | 388 optParamIn(CheckpointIn &cp, const string &name, type & param, \ 389 bool warn); \ |
388 template void \ 389 arrayParamOut(CheckpointOut &os, const string &name, \ 390 type const *param, unsigned size); \ 391 template void \ 392 arrayParamIn(CheckpointIn &cp, const string &name, \ 393 type *param, unsigned size); \ 394 template void \ 395 arrayParamOut(CheckpointOut &os, const string &name, \ --- 220 unchanged lines hidden --- | 390 template void \ 391 arrayParamOut(CheckpointOut &os, const string &name, \ 392 type const *param, unsigned size); \ 393 template void \ 394 arrayParamIn(CheckpointIn &cp, const string &name, \ 395 type *param, unsigned size); \ 396 template void \ 397 arrayParamOut(CheckpointOut &os, const string &name, \ --- 220 unchanged lines hidden --- |