Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QUniqueId class provides an identifier that is unique and yet can be stored efficiently. More...
#include <QUniqueId>
The QUniqueId class provides an identifier that is unique and yet can be stored efficiently.
The unique identifiers are 32 bits and are unique within the device they is created upon. If you require an identifier that is unique across multiple devices use QUuid instead. The QUniqueId objects are composed of an 8 bit context representing the data source that created them and a 24 bit index component. The unique identifiers are intended for record identifiers such as user contacts. Given the limited space of identifiers they are unsuitable for use as identifiers that might get created on the order of thousands per day.
The context identifier should be generated with a program such as uuidgen and represent the data store or context within which the identifier is generated. For example SQL, and SIM card storage for QContacts each have their own context.
See also QUniqueIdGenerator.
Constructs a null QUniqueId.
Constructs a copy of other.
Constructs a QUniqueId based on the given string.
Constructs a QUniqueId based on the given array.
Returns the context component of the identifier.
See also index().
Reads the identifier from the given stream, and returns a reference to the stream. This function is not suitable for streaming data from another device or from a file that may have been transferred from another device.
Converts the packed value to a QUniqueId,
See also toUInt().
Returns the index component of the identifier.
See also context().
Returns true if the identifier is null. Otherwise returns false.
Returns true if this is a temporary identifier, otherwise returns false.
Temporary identifiers are scoped so as not to conflict with other identifiers.
They are suitable for working with data sets when the identifiers are not intended to be permanent.
Returns a locally mapped integer value for the context of the id. This is useful for efficiently checking if a QUniqueId was generated from an equivalent QUniqueIdGenerator.
See also QUniqueIdGenerator::mappedContext().
Converts the identifier to a byte array. The byte array contains the expanded form of the context. This allows the identifier to be backed up independent of the internal mapping of context QUuid to the internal context component.
See also toLocalContextByteArray().
Converts the identifier to a byte array. The mapped representation of the context will be written rather than the expanded QUuid. If the tracking or generating file is reset this byte array won't be usable to gain the original id.
See also toByteArray().
Writes the identifier to the given stream, and returns a reference to the stream. This function is not suitable for streaming data to another device or to a file that may be transferred to another device.
Converts the identifier to a string. This string will only include latin1 characters, and will contains the mapped context. If the tracking or generating file is reset this string won't be usable to gain the original id.
See also toString().
Converts the identifier to a string. This string will only include latin1 characters and contains the expanded form of the context. This allows the identifier to be backed up independent of the internal mapping of context QUuid to the internal context component.
See also toLocalContextString().
Converts the identifier to a packed value containing both the context and index components of the identifier.
See also fromUInt().
Returns true if the identifier is not equal to i. Otherwise returns false.
Returns true if the identifier is less than i. Otherwise returns false.
Returns true if the identifier is less than or equal to i. Otherwise returns false.
Assigns the value of identifier o to this identifier.
Returns true if the identifier is equal to i. Otherwise returns false.
Returns true if the identifier is greater than i. Otherwise returns false.
Returns true if the identifier is greater than or equal to i. Otherwise returns false.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |