Defined in file: hzDatabase.h
As described in the Library Overview (2.3.h1 Data Classes), hzAtom holds a single datum of any atomic HadronZoo data type and so serves as a universal means of passing and holding atomic values. hzAtom comprises an atomval union with members of types char*, double, 64, 32, 16 and 8-bit signed and unsigned integers and a bool - together with a hzBasetype indicator, a hzString, a hzChain and control flags. An atomval on its own cannot state which of its members applies and nor can it disambiguate zero, hence the control flags. The hzString is used to directly hold the value where the type is BASETYPE_STRING and where the type is BASETYPE_DOMAIN, BASETYPE_EMADDR or BASETYPE_URL, to hold the value as a string form. The hzString also enables hzAtom to avail the text form of any of the non-binary types held by atomval. The hzChain holds datum of binary data types.
Constructors/Detructors
| hzAtom* | hzAtom | (void) | Standard constructor. The atom will be empty and be of unknown type. |
| hzAtom* | hzAtom | (hzAtom& op) | Copy constructor. The atom will be of the type and value of the operand. |
| void | ~hzAtom | (void) | Destructor. This will delete any strings the atom had retained. |
Public Methods:
| const void* | Binary | (void) | |
| bool | Bool | (void) | |
| char | Byte | (void) | |
| hzChain | Chain | (void) | Retrieve hzChain from this atom. This will be populated if the hzAtom has a value and the datatype is BASETYPE_STRING, and will be empty otherwise Arguments: None |
| hzAtom& | Clear | (void) | Clear the atom value to null. Note this does not set the type to undefined. Arguments: None |
| const char* | Cstr | (void) | Retrieve Cstr from this atom. This will be populated if the hzAtom has a value and the datatype is BASETYPE_STRING, regardless of how the string value was set. Arguments: None |
| _atomval | Datum | (void) | |
| hzDomain | Domain | (void) | Retrieve domain name from this atom. This will be populated if the hzAtom has a value and the datatype is BASETYPE_DOMAIN and be empty otherwise Arguments: None |
| double | Double | (void) | |
| hzEmaddr | Emaddr | (void) | Retrieve email address from this atom. This will be populated if the hzAtom has a value and the datatype is BASETYPE_EMADDR and be empty otherwise Arguments: None |
| int16_t | Int16 | (void) | |
| int32_t | Int32 | (void) | |
| int64_t | Int64 | (void) | |
| hzIpaddr | Ipaddr | (void) | Arguments: None |
| bool | IsNull | (void) | |
| bool | IsSet | (void) | |
| hzMD5 | MD5 | (void) | Retrieve hzMD5 from this atom. Arguments: None |
| hzSDate | SDate | (void) | Arguments: None |
| hzEcode | SetNumber | (const char* s) | Set atom to a numeric data type and value if the supplied string amounts to a numberic value, i.e. is of the form [sign] digits [[.] digits] [[e][sign]digits] |
| hzEcode | SetNumber | (hzString& s) | |
| hzEcode | SetValue | (hdbBasetype eType)hzString& S, | Set the atom to the supplied data type and value. |
| hzEcode | SetValue | (hdbBasetype eType)_atomval& av, | Set the atom to the supplied data type and value (supplied in an _atomval) |
| const char* | Show | (void) | Purpose: Formulate a textual representation of the atom value |
| uint32_t | Status | (void) | |
| hzString | Str | (void) | Retrieve string from this atom. This will be populated only if the hzAtom has a value, the datatype is BASETYPE_STRING, and the string value was set to an actual hzString instance, as opposed to being set to a string held in a string repository. Arguments: None |
| hzTime | Time | (void) | Arguments: None |
| hdbBasetype | Type | (void) | |
| unsigned char | UByte | (void) | |
| uint16_t | Unt16 | (void) | |
| uint32_t | Unt32 | (void) | |
| uint64_t | Unt64 | (void) | |
| hzUrl | Url | (void) | Retrieve URL from this atom. This will be populated if the hzAtom has a value and the datatype is BASETYPE_EMADDR and be empty otherwise Arguments: None |
| hzXDate | XDate | (void) | Arguments: None |
Overloaded operators:
Member Variables:
| _atomval | m_Data | Actual data or pointer to document/binary/start of list | |
| uint16_t | m_Resv | Reserved | |
| uint16_t | m_eStatus | Set on assignment, either NULL, OK or some error | |
| hdbBasetype | m_eType | Data type adopted |