Return TypeFunction nameArguments
hzEcodehdbObjRepos::Fetch(hdbObject&,unsigned int,)

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

Function Logic:

0:START 1:_hdb_ck_initstate 2:obj.Class()!=m_pClass 3:hdbObjRepos::Classname hdbObject::Classname hzexit 4:hdbObject::Clear 5:objId>m_pMain->Count() 6:Return hzerr(E_NOTFOUND,Beyond Range %u\n,m_pMain->Count()) 7:m_pMain 8:hdbObjRepos::_cache::FetchEDO rc 9:rc!=E_OK 10:Return rc 11:hdbObject::ImportEDO rc 12:rc!=E_OK 13:Return rc 14:hdbObject::Integrity rc 15:rc!=E_OK 16:items ei 17:!ei.eof(); 18:hzChain::Printf 19:items Err2Txt 20:Return rc 21:Return rc

Function body:

hzEcode hdbObjRepos::Fetch (hdbObject& obj, unsigned int objId)
{
   _hzfunc("hdbObjRepos::Fetch") ;
   hzChain     edo ;
   hzEcode     rc = E_OK ;
   _hdb_ck_initstate(m_Name, m_eReposInit, HDB_REPOS_OPEN) ;
   if (obj.Class() != m_pClass)
       hzexit(E_TYPE, "Repository %s is of class %s. Supplied object is of class %s", *m_Name, Classname(), obj.Classname()) ;
   obj.Clear() ;
   if (objId > m_pMain->Count())
       return hzerr(E_NOTFOUND, "Beyond Range %u\n", m_pMain->Count()) ;
   if (m_pMain)
   {
       rc = m_pMain->FetchEDO(edo, objId) ;
       if (rc != E_OK)
       {
           threadLog("FetchEDO failed\n") ;
           return rc ;
       }
       rc = obj.ImportEDO(edo) ;
       if (rc != E_OK)
       {
           threadLog("ImportEDO failed\n") ;
           return rc ;
       }
       rc = obj.Integrity() ;
       if (rc != E_OK)
       {
           hzChain     err ;
           chIter      ei ;
           err << "EDO is [ " ;
           for (ei = edo ; !ei.eof() ; ei++)
           {
               err.Printf("%02x ", (uchar) *ei) ;
           }
           err << "]\n" ;
           threadLog(err) ;
           threadLog("Integrity check failed err=%s\n", Err2Txt(rc)) ;
       }
       return rc ;
   }
   return rc ;
}