Set the supplied atom with the value of the supplied member. Note that for BINARY/TXTDOC members, the atom is set with the binary datum id, not the binary datum value.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbObject::GetValue | (hzAtom&,hdbMember*,uint32_t,) |
Declared in file: hzDatabase.h
Defined in file : hdbObject.cpp
Function Logic:
Function body:
hzEcode hdbObject::GetValue (hzAtom& atom)hdbMember* pMbr, uint32_t nOset,
{
// Set the supplied atom with the value of the supplied member. Note that for BINARY/TXTDOC members, the atom is set with the binary datum id, not the binary datum value.
//
// Arguments: 1) atom The atom to be set
// 2) pMbr Pointer to the data class member
// 3) nOset Default 0, applicable only if the member is an array
//
// Returns: E_NOINIT If the object has not been initialized to a class
// E_CORRUPT If the supplied member number does not identify an object class member.
// E_TYPE If the object class member is not atomic (is another class) or if the supplied atom has the wrong type.
// E_RANGE If the requested element (nOset) exceeds the number of member values
// E_OK If the object class member has been set to the supplied atom value.
_hzfunc("hdbObject::GetValue(atom)") ;
_atomval av ; // Value from atom
// uchar* pLitmus ; // Litmus bits
// uchar* pMCS ; // Pointer to member core space
atom.Clear() ;
// Object has class?
if (!m_pClass) return hzerr(E_NOINIT, "Object has no class") ;
if (!pMbr) return hzerr(E_ARGUMENT, "No member supplied") ;
if (pMbr->Class() != m_pClass)
return hzerr(E_CORRUPT, "Member %s does not belong to class %s", pMbr->txtName(), m_pClass->txtName()) ;
// For BOOL and TBOOL members, values are read from the litmus bits
if (pMbr->Basetype() == BASETYPE_CLASS)
return E_TYPE ;
if (!m_pRoot)
return E_OK ;
return m_pRoot->GetValue(atom, pMbr, nOset) ;
}