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-TYPE | hdbClass | (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_t | ClassId | (void) | |
| uint32_t | CoreLen | (void) | |
| hzString& | Desc | (void) | |
| hzEcode | DescCheck | (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. |
| void | DescClass | (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 |
| hdbClsDgn | Designation | (void) | |
| hdbADP* | GetADP | (void) | |
| hdbMember* | GetMember | (hzString& mbr) | |
| hdbMember* | GetMember | (uint32_t mbrNo) | |
| bool | HasArrays | (void) | |
| bool | HasBinaries | (void) | |
| hzEcode | InitDone | (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 |
| hzEcode | InitMember | (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. |
| hzEcode | InitMember | (hzString& mbrName)hzString& typeName, hdbPopCtl popCtl, | |
| hzEcode | InitStart | (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. |
| bool | IsInit | (void) | |
| uint32_t | LitmusBits | (void) | |
| uint32_t | LitmusSize | (void) | |
| uint32_t | MbrCount | (void) | |
| uint32_t | MemberNo | (hzString& mbr) | |
| uint32_t | NonBool | (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:
| bool | operator!= | (hdbClass& op) | |
| hdbClass& | operator= | (hdbClass& op) | |
| bool | operator== | (hdbClass& op) | Test for equality between hdbClass instances (this row has same columns and column settings as the operand) |
Member Variables:
| hzString | m_Category | This has no database purpose but is helpful for Dissemino | |
| uint16_t | m_ClassUID | Unique class id | |
| hzString | m_Desc | XML Description | |
| hzArray<hdbMember*> | m_arrMembers | Members in order of incidence | |
| hdbIniStat | m_eClassInit | Init state | |
| uint16_t | m_eDesignation | Class designated as system, user or general | |
| hzMapS<hzString,hdbMember*> | m_mapMembers | Members by member name | |
| unsigned char | m_nArrays | Number of members that expect arrays | |
| unsigned char | m_nBinaries | Number of members with BINARY/TXTDOC types | |
| uint16_t | m_nCoreLen | Total core size needed in hdbObject (includes bytes to host litmus bits) | |
| uint16_t | m_nLitmusBits | Total number of litmus bits needed to indicate the presence of member values | |
| uint16_t | m_nLitmusSize | Bytes needed to accommodate the litmus bits (1 byte per 8 bits or part thereof) | |
| hdbADP* | m_pADP | Host ADP |