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)
boolBool(void)
charByte(void)
hzChainChain(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
_atomvalDatum(void)
hzDomainDomain(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
doubleDouble(void)
hzEmaddrEmaddr(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_tInt16(void)
int32_tInt32(void)
int64_tInt64(void)
hzIpaddrIpaddr(void)Arguments: None
boolIsNull(void)
boolIsSet(void)
hzMD5MD5(void)Retrieve hzMD5 from this atom. Arguments: None
hzSDateSDate(void)Arguments: None
hzEcodeSetNumber(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]
hzEcodeSetNumber(hzString& s)
hzEcodeSetValue(hdbBasetype eType)hzString& S, Set the atom to the supplied data type and value.
hzEcodeSetValue(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_tStatus(void)
hzStringStr(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
hzTimeTime(void)Arguments: None
hdbBasetypeType(void)
unsigned charUByte(void)
uint16_tUnt16(void)
uint32_tUnt32(void)
uint64_tUnt64(void)
hzUrlUrl(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
hzXDateXDate(void)Arguments: None

Overloaded operators:

charoperator char(void)
const char*operator const char *(void)
hzChainoperator const hzChain(void)
hzDomainoperator const hzDomain(void)
hzEmaddroperator const hzEmaddr(void)
hzIpaddroperator const hzIpaddr(void)
hzSDateoperator const hzSDate(void)
hzTimeoperator const hzTime(void)
hzUrloperator const hzUrl(void)
hzXDateoperator const hzXDate(void)
doubleoperator double(void)
int32_toperator int32_t(void)
int64_toperator int64_t(void)
int16_toperator int64_t(void)
unsigned charoperator uchar(void)
uint16_toperator uint16_t(void)
uint32_toperator uint32_t(void)
uint64_toperator uint64_t(void)
ostream&operator<<(ostream& os)hzAtom& obj,
hzAtom&operator=(hzAtom& op)Set atom type and value to that of another, operand atom.
hzAtom&operator=(hzMD5& md5)
hzAtom&operator=(hzChain& Z)Set atom value to a chain.
hzAtom&operator=(hzString& S)Set atom value to a string.
hzAtom&operator=(hzIpaddr& ipa)Set atom value to an IP address.
hzAtom&operator=(hzDomain& dom)
hzAtom&operator=(hzEmaddr& ema)Set atom value to an email address.
hzAtom&operator=(hzUrl& url)Set atom value to a URL
hzAtom&operator=(hzXDate& xd)Set atom value to a full date.
hzAtom&operator=(hzSDate& sd)Set atom value to a short date.
hzAtom&operator=(hzTime& time)Set atom value to a time. Note that this function will have no effect unless the atom has type of undefined or of BASETYPE_TIME
hzAtom&operator=(double val)If the current atom type is unknown or double, set the value
hzAtom&operator=(int64_t val)If the current atom type is unknown or int64_t, set the value
hzAtom&operator=(uint64_t val)If the current atom type is unknown or unt64, set the value
hzAtom&operator=(int32_t val)If the current atom type is unknown or int32_t, set the value
hzAtom&operator=(uint32_t val)If the current atom type is unknown or uint32_t, set the value
hzAtom&operator=(int16_t val)If the current atom type is unknown or int16_t, set the value
hzAtom&operator=(uint16_t val)If the current atom type is unknown or uint16_t, set the value
hzAtom&operator=(char val)Set the atom value to the supplied char. The type of the atom will need to be either undefined or one of the numeric types.
hzAtom&operator=(unsigned char val)Set the atom value to the supplied unsigned char. The type of the atom will need to be either undefined or one of the numeric types.
hzAtom&operator=(bool b)Set the atom value to the supplied boolean. The type of the atom will need to be either undefined or TYPE_BOOL

Member Variables:

_atomvalm_DataActual data or pointer to document/binary/start of list
uint16_tm_ResvReserved
uint16_tm_eStatusSet on assignment, either NULL, OK or some error
hdbBasetypem_eTypeData type adopted