Defined in file: hzDatabase.h

Derivative of: hdbDatatype

hdbClass defines a data class as a set of data class members with each having a name (unique within the class), a predefined data type, and value population restraints. As data classes are themselves data types, the data type a member may be of, includes previously defined data classes. Thus, within a data object of a main class, members can hold data objects of a subclass. By this means, hdbClass supports hierarchy. Defining a data class is a matter of initializing a hdbClass instance, which involves a sequence of function calls. The sequence begins with a call to InitStart(), then for each member a call to InitMember(), then finally, a call to InitDone(). If this sequence is violated, the program terminates. Data Class Member Delta IDs: Note that data classes are assigned a unique class id and a delta id, and are generally referred to by the latter which will depend on the context of the class. If the data class has no subclass members, the two ids will always be the same. However where a class is used as a subclass, its delta id will differ from the pure id. This regime is described in the HadronZoo Library Overview.

Constructors/Detructors

hdbClass*hdbClass(hdbClass& op)
hdbClass*hdbClass(hdbADP& adp)hdbClsDgn designation,
NULL-TYPEhdbClass(hdbADP& adp)hdbClsDgn designation, Data class constructor. Note the expectation that the data class will belong to a pre-existing ADP
void~hdbClass(void)
NULL-TYPE~hdbClass(void)

Public Methods:

uint32_tClassId(void)
uint32_tCoreLen(void)
hzString&Desc(void)
hzEcodeDescCheck(hzChain& report)hzChain& desc, Check Class Description With the class initialized, it is possible to check that a class description in a delta or other repository file, matches the class. The description is supplied as a hzChain which is obtained by reading the file or file header. This function loads the hzChain into an XML document and then extracts tags describing the class and its members. Write out XML fragment describing the data class to the supplied chain. Note that as the class description is likely to be part of an Application Delta Profile, the supplied chain is not pre-cleared by this function. Read a <class> tag on behalf of the hdbADProfile::Import function.
voidDescClass(hzChain& Z)uint32_t nIndent, Export Class Description Export XML fragment describing the data class to the supplied chain. Note that as the class description is expected to be part of an ADP, the supplied chain is not cleared by this function. Returns: None
hdbClsDgnDesignation(void)
hdbADP*GetADP(void)
hdbMember*GetMember(hzString& mbr)
hdbMember*GetMember(uint32_t mbrNo)
boolHasArrays(void)
boolHasBinaries(void)
hzEcodeInitDone(void)Complete the initialization sequence. This is a mainly a matter of calculating how member space within hdbObject will be arranged. Members are assigned space that depends on the datatype and max population, and they are given relative positions that ensure the correct byte alignment. To this end the members are first sorted by datum size ... Arguments: None
hzEcodeInitMember(hzString& mbrName)hdbDatatype* pType, hdbPopCtl popCtl, Adds a member to the data class Note: This function will terminate execution if the member could not be allocated.
hzEcodeInitMember(hzString& mbrName)hzString& typeName, hdbPopCtl popCtl,
hzEcodeInitStart(hzString& className)Init Start function. This must be called only on a hdbClass instance that is not initialized and which is not in the process of being initialized.
boolIsInit(void)
uint32_tLitmusBits(void)
uint32_tLitmusSize(void)
uint32_tMbrCount(void)
uint32_tMemberNo(hzString& mbr)
uint32_tNonBool(void)
void_clear(void)Private function to clear data object class descriptor. Note this is always assumed to be successful Arguments: None Returns: None
hzEcode_setId(uint32_t nId)Set class UID.

Overloaded operators:

booloperator!=(hdbClass& op)
hdbClass&operator=(hdbClass& op)
booloperator==(hdbClass& op)Test for equality between hdbClass instances (this row has same columns and column settings as the operand)

Member Variables:

hzStringm_CategoryThis has no database purpose but is helpful for Dissemino
uint16_tm_ClassUIDUnique class id
hzStringm_DescXML Description
hzArray<hdbMember*>m_arrMembersMembers in order of incidence
hdbIniStatm_eClassInitInit state
uint16_tm_eDesignationClass designated as system, user or general
hzMapS<hzString,hdbMember*>m_mapMembersMembers by member name
unsigned charm_nArraysNumber of members that expect arrays
unsigned charm_nBinariesNumber of members with BINARY/TXTDOC types
uint16_tm_nCoreLenTotal core size needed in hdbObject (includes bytes to host litmus bits)
uint16_tm_nLitmusBitsTotal number of litmus bits needed to indicate the presence of member values
uint16_tm_nLitmusSizeBytes needed to accommodate the litmus bits (1 byte per 8 bits or part thereof)
hdbADP*m_pADPHost ADP