Defined in file: hzDatabase.h
Derivative of: hdbIndex
hdbIndexUkey (unique key index), ensures objects in a repository are unique on the member to which the index applies. hdbIndexUkey can be applied to members with any string like or numeric data type with a maximum population of 1. hdbIndexUkey is implimented as direct, 1:1 mappings between values and object ids. Thus, for every value found in the index, there will be a single object in the repository that will have that value for the applicable data class member. hdbIndexUkey is generally applied to inherently unique data, such as usernames and email addresses. Note that as hdbIndexUkey can be applied to members with either string like or numeric data types, the mapping regime must be able to cope with this. By means of a union of map pointers, the maping can be between a key of string or a 64-bit or 32-bit number - and the 32-bit object id.
Constructors/Detructors
| hdbIndexUkey* | hdbIndexUkey | (void) | |
| void | ~hdbIndexUkey | (void) |
Public Methods:
| hdbBasetype | Basetype | (void) | |
| hzEcode | Delete | (hzAtom& key) | Remove the key/object pair named by the supplied key, from the index |
| void | Halt | (void) | Save index to disk and close files Arguments: None Returns: None |
| hzEcode | Init | (hdbObjRepos* pRepos)hzString& mbrName, hdbBasetype dtype, | hdbIndexUkey is implimented as a 1:1 map between unique keys and the id of the data object that has the key. As HDB indexes are applied to data object members, the map must use keys of the same data type as the member concerned. hdbIndexUkey initialization is a matter of checking that the data type is compatible with a hdbIndexUkey index, then of creating a 1:1 map of the type to object ids (uint32_t). |
| hzEcode | Insert | (hzAtom& atom)uint32_t objId, | Insert an atomic-value/object-id pair into the unique key index. Note that as hdbIndexUkey can only be applied to data members with a minimun and maximum population of 1, the member cannot be NULL and therefore a NULL value to insert is an error. |
| hzEcode | Select | (uint32_t& Result)hzAtom& key, | Find the single object matching the supplied key - if it exists. |
| hdbIdxtype | Whatami | (void) |
Member Variables:
| bool | m_bInit | Init state | |
| hdbBasetype | m_eBasetype | The type | |
| _ptrset | m_keys | The key |