QtCraft API C++ classes QML types Handbook

QcIndexId Class

template <typename Tag> class QcIndexId

The index of a definition in a list of its own kind, as a type of its own per list (decision E-952): Tag tells the lists apart, so an index of one list cannot pass for one of another. More...

Header: #include <common/core/QcIndexId.h>

Public Functions

QcIndexId()
QcIndexId(int index)
int index() const

Detailed Description

It converts neither from nor to an integer by itself: codecs write index() as the integer of the format and construct the id from the integer they read. A default-constructed id is the first entry (index 0). Ids order and hash by their index; QcIdList indexes a list by them.

Member Function Documentation

[constexpr default] QcIndexId::QcIndexId()

Constructs the id of the first entry (index 0).

[explicit constexpr] QcIndexId::QcIndexId(int index)

Constructs the id of the entry with the index index.

[constexpr] int QcIndexId::index() const

Returns the index of the entry in its list.