MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / addRegister

Method addRegister

app/src/DataModel/DataTable.cpp:543–555  ·  view source on GitHub ↗

* @brief Allocates a new register in the flat storage. */

Source from the content-addressed store, hash-verified

541 * @brief Allocates a new register in the flat storage.
542 */
543void 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.

Callers 1

registerAddMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected