* @brief Allocates a new register in the flat storage. */
| 541 | * @brief Allocates a new register in the flat storage. |
| 542 | */ |
| 543 | void DataModel::DataTableStore::addRegister(const QString& table, |
| 544 | const QString& reg, |
| 545 | const RegisterValue& defaultVal, |
| 546 | RegisterType type) |
| 547 | { |
| 548 | const int offset = static_cast<int>(m_storage.size()); |
| 549 | const bool isComputed = (type == RegisterType::Computed); |
| 550 | |
| 551 | m_storage.push_back(defaultVal); |
| 552 | m_isComputed.push_back(isComputed); |
| 553 | m_version.push_back(0); |
| 554 | m_index.insert(qMakePair(table, reg), offset); |
| 555 | } |
| 556 | |
| 557 | /** |
| 558 | * @brief Resolves a (table, register) pair to a storage offset, or -1. |