Set member value within data object. The object must be initialized to a data class, and the supplied member must exist within that class
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbObject::SetValue | (hdbMember*,hzAtom&,) |
Declared in file: hzDatabase.h
Defined in file : hdbObject.cpp
Function Logic:
Function body:
hzEcode hdbObject::SetValue (hdbMember* pMbr)hzAtom& atom,
{
// Set member value within data object. The object must be initialized to a data class, and the supplied member must exist within that class
//
// Arguments: 1) pMbr The member
// 2) atom The atomic value the member will be set to
//
// Returns: E_NOINIT If the object has not been initialized to a class
// E_ARGUMENT If no member is supplied
// 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_OK If the object class member has been set to the supplied atom value.
_hzfunc("hdbObject::SetValue") ;
// _atomval av ; // atom data
// uchar* pLitmus ; // Litmus bits
// uchar* pMCS ; // Pointer to member core space
// Object has class?
if (!this) hzexit(E_CORRUPT, "No instance") ;
if (!m_pClass) return hzerr(E_NOINIT, "Single object container not init to a data 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()) ;
// Check status
if (atom.Status() == ATOM_ERROR)
return hzerr(E_BADVALUE, "Member %s not set", pMbr->txtName()) ;
if (!m_pRoot)
m_pRoot = _obj_data::GetInstance(m_pClass) ;
return m_pRoot->SetValue(pMbr, atom) ;
}