Base Data Types

The HDB (and thus the web engine), stores data as data objects in data object repositories, not as rows in tables. A repository can only store objects of the data class to which it is initialized (the native data class). Thus, before a repository can be declared (created), the data class it will use, must be defined. Data classes are much as they would be in any computer language - they comprise one or more members which must be of a previously defined data type.

Some data types are fundamental C++ types, some have been adopted as standard by HadronZoo, others will be specific to the application. In order to provide an overall framework for data types, the HadronZoo library provides the hdbBasetype enumeration. This places data types in five groups as follows:-

 Group 1: Fundamental C++ types (fixed size)  
 BASETYPE_DOUBLE 0x010164 bit floating point value
 BASETYPE_INT64 0x010264-bit Signed integer
 BASETYPE_INT32 0x010332-bit Signed integer
 BASETYPE_INT16 0x010416-bit Signed integer
 BASETYPE_BYTE 0x01058-bit Signed integer
 BASETYPE_UINT64 0x010664-bit Positive integer
 BASETYPE_UINT32 0x010732-bit Positive integer
 BASETYPE_UINT16 0x010816-bit Positive integer
 BASETYPE_UBYTE 0x01098-bit Positive integer
 BASETYPE_BOOL 0x010AEither true or false, cannot be empty or have mutiple values
 Group 2: HadronZoo Defined types (fixed size)  
 BASETYPE_TBOOL 0x0201Either true, false or don't know (empty). Cannot have mutiple values
 BASETYPE_DOMAIN 0x0202Internet domain
 BASETYPE_EMADDR 0x0203Email Address
 BASETYPE_URL 0x0204Universal Resource Locator
 BASETYPE_IPADDR 0x0205IP Address
 BASETYPE_TIME 0x0206No of seconds since midnight (4 bytes)
 BASETYPE_SDATE 0x0207No of days since Jan 1st year 0000
 BASETYPE_XDATE 0x0208Full date and time
 BASETYPE_STRING 0x0209Single value string, can be indexed by value (e.g. First or last name)
 BASETYPE_TEXT 0x020AText document, can use free text indexation. Stored as part of a data object.
 BASETYPE_TXTDOC 0x020BThe same as TEXT but stored separately from the data object, in a binary datum repository.
 BASETYPE_TXTSRC 0x020CEncoded document from which text could be extracted (if a suitable decoder is provided).
 BASETYPE_BINARY 0x020DBinary object, assummed to be un-indexable (e.g. image).
 Group 3: Application defined data enumerations  
 BASETYPE_ENUM 0x1001Data enumeration
 Group 4: Application defined special text types  
 BASETYPE_APPDEF 0x2000String subject to special interpretation by the application (e.g. serial numbers).
 Group 5: Standard and application defined data class  
 BASETYPE_CLASS 0x4000Sub-class (instances stored as part of host class instance).

Note 1: In the actual hdbBasetype enum, defined in hzDatabase.h, the type names are prefixed with 'BASETYPE_'. However, for the purposes of this manual, this prefix is ignored.

Note 2: The data types in groups 1 and 2 are completely defined by the hdbBasetype and require no further qualification. By contrast, the application specific data types, groups 3, 4 and 5 do require further qualification, with the hdbBasetype serving only to state the data type is an enum, a string of a format peculiar to the application, or a data class.

Note 3: Groups 1, 2, 3 and 4 are atomic, meaning that their values are either fundamentally indivisible or are treated as indivisible by the HDB. However group 5, the data classes are composite, since they consist of one or more members.