Either add a new subclass data object or return a modified subclass data object, to the supplied host class member. In the case of a new subclass data object, the object id will be zero. In the case of a modified subclass data object, this must necessarily have been fetched, so will have the object id it was given when originally added. This object must be initialized to the host data class and the supplied data object must be initialized to subclass introduced by the applicable host class member.

Return TypeFunction nameArguments
hzEcodehdbObject::SetObject(hdbMember*,hdbObject&,)

Declared in file: hzDatabase.h
Defined in file : hdbObject.cpp

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:Return hzerr(E_NOINIT,Single object container not init to a data class) 5:unknown 6:Return hzerr(E_NOINIT,Operand object container not init to a data class) 7:unknown 8:Return hzerr(E_ARGUMENT,No member supplied) 9:unknown 10:Return hzerr(E_CORRUPT,Member %s does not belong to class %s,pMbr->txtName(),m_pClass->txtName()) 11:unknown 12:Return hzerr(E_TYPE,Member %s is atomic,pMbr->txtName()) 13:unknown 14:Return hzerr(E_TYPE,Member %s is not of type class %s,pMbr->txtName(),sub.m_pClass->txtName()) 15:unknown 16:m_pRoot 17:Return m_pRoot->SetObject(pMbr,sub.m_pRoot)

Function body:

hzEcode hdbObject::SetObject (hdbMember* pMbr)hdbObject& sub, 
{
   //  Either add a new subclass data object or return a modified subclass data object, to the supplied host class member. In the case of a new subclass data object, the object id
   //  will be zero. In the case of a modified subclass data object, this must necessarily have been fetched, so will have the object id it was given when originally added.
   //  
   //  This object must be initialized to the host data class and the supplied data object must be initialized to subclass introduced by the applicable host class member.
   //  
   //  Arguments: 1) pMbr The subclass member of this, the host class object
   //     2) sub  The subclass object to be placed in the pMbr array of objects
   //  
   //  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::SetObject") ;
   //  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 (!sub.m_pClass)  return hzerr(E_NOINIT, "Operand 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()) ;
   if (pMbr->Basetype() != BASETYPE_CLASS)
       return hzerr(E_TYPE, "Member %s is atomic", pMbr->txtName()) ;
   if (pMbr->Datatype() != sub.m_pClass)
       return hzerr(E_TYPE, "Member %s is not of type class %s", pMbr->txtName(), sub.m_pClass->txtName()) ;
   if (!m_pRoot)
       m_pRoot = _obj_data::GetInstance(m_pClass) ;
   return m_pRoot->SetObject(pMbr, sub.m_pRoot) ;
}