1/* 2 * Copyright (c) 2015, 2018 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 --- 460 unchanged lines hidden (view full) --- 469 showParam(os, param[0]); 470 for (unsigned i = 1; i < size; ++i) { 471 os << " "; 472 showParam(os, param[i]); 473 } 474 os << "\n"; 475} 476 |
477/** 478 * Extract values stored in the checkpoint, and assign them to the provided 479 * array container. 480 * 481 * @param cp The checkpoint to be parsed. 482 * @param name Name of the container. 483 * @param param The array container. 484 * @param size The expected number of entries to be extracted. 485 */ |
486template <class T> 487void 488arrayParamIn(CheckpointIn &cp, const std::string &name, 489 T *param, unsigned size) 490{ 491 const std::string §ion(Serializable::currentSection()); 492 std::string str; 493 if (!cp.find(section, name, str)) { --- 5 unchanged lines hidden (view full) --- 499 500 std::vector<std::string> tokens; 501 502 tokenize(tokens, str, ' '); 503 504 // Need this if we were doing a vector 505 // value.resize(tokens.size()); 506 |
507 fatal_if(tokens.size() != size, 508 "Array size mismatch on %s:%s (Got %u, expected %u)'\n", 509 section, name, tokens.size(), size); |
510 511 for (std::vector<std::string>::size_type i = 0; i < tokens.size(); i++) { 512 // need to parse into local variable to handle vector<bool>, 513 // for which operator[] returns a special reference class 514 // that's not the same as 'bool&', (since it's a packed 515 // vector) 516 T scalar_value; 517 if (!parseParam(tokens[i], scalar_value)) { --- 173 unchanged lines hidden --- |