Place the actual binary datum member value into the supplied chain. This requires the object container to name a source repository.

Return TypeFunction nameArguments
hzEcodehdbObject::GetBinary(hzChain&,hdbMember*,)

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

Function Logic:

0:START 1:unknown 2:Return hzerr(E_NOINIT,Object has no class) 3:unknown 4:Return hzerr(E_ARGUMENT,No member supplied) 5:unknown 6:Return hzerr(E_CORRUPT,Member %s does not belong to class %s,pMbr->txtName(),m_pClass->txtName()) 7:unknown 8:Return E_TYPE 9:items 10:unknown 11:Return hzerr(E_NOINIT,No repository) 12:unknown 13:Return hzerr(E_NOINIT,Associated repository has no binary datum repository) 14:unknown 15:Return E_OK 16:m_pRoot 17:pCh 18:unknown 19:Z 20:Return E_OK 21:m_pRoot 22:pId 23:unknown 24:rc 25:Return rc

Function body:

hzEcode hdbObject::GetBinary (hzChain& Z)hdbMember* pMbr, 
{
   //  Place the actual binary datum member value into the supplied chain. This requires the object container to name a source repository.
   //  
   //  Arguments: 1) Z  The hzChain to be set
   //     2) pMbr Pointer to the data class member
   //  
   //  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_NODATA If the binary datum repository could not be identified
   //     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::GetBinary") ;
   hzChain*            pCh ;           //  Internal cast (binary datum)
   uint32_t*           pId ;           //  Internal cast (binary datum id)
   hzEcode             rc = E_OK ;     //  Return code 
   //  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()) ;
   //  Check member data type
   if (pMbr->Basetype() != BASETYPE_BINARY && pMbr->Basetype() != BASETYPE_TXTDOC)
       return E_TYPE ;
   Z.Clear() ;
   //  Check for the default binary datum repository of the associated data object repository
   if (!m_pRepos)
       return hzerr(E_NOINIT, "No repository") ;
   if (!m_pRepos->BinRepos())
       return hzerr(E_NOINIT, "Associated repository has no binary datum repository") ;
   if (!m_pRoot)
       return E_OK ;
   //  The member space may already hold the binary in hzChain form. If so simply copy it
   pCh = (hzChain*) (m_pRoot->m_Core + pMbr->OsetAux()) ;
   if (pCh->Size())
   {
       Z = *pCh ;
       return E_OK ;
   }
   //  Binary datum not in-situ, fetch from the binary datum repository
   pId = (uint32_t*) (m_pRoot->m_Core + pMbr->OsetStd()) ;
   if (*pId)
   {
       //  Fetch chain from the binary datum repository
       rc = m_pRepos->BinRepos()->Fetch(Z, *pId) ;
   }
   return rc ;
}