Delete the object with the supplied object id. This results in the following action:- A delete marker is added to the delta file If the repository has a cache, the object EDO will be removed from it. The whole object delta is NOT removed from the internal binary repository, m_pBR_Delta. This will wait until rationalization.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbObjRepos::Delete | (uint32_t,) |
Declared in file: hzDatabase.h
Defined in file : hdbObjRepos.cpp
Function Logic:
Function body:
hzEcode hdbObjRepos::Delete (uint32_t objId)
{
// Delete the object with the supplied object id.
//
// This results in the following action:-
// A delete marker is added to the delta file
// If the repository has a cache, the object EDO will be removed from it.
//
// The whole object delta is NOT removed from the internal binary repository, m_pBR_Delta. This will wait until rationalization.
//
// Argument: objId The target object id
//
// Returns: E_NOINIT If the repository is not initialized
// E_NOTFOUND If the object indicated by the object id, does not exist
// E_OK Operation successful
_hzfunc("hdbObjRepos::Delete") ;
char dBuf[32];
_hdb_ck_initstate(m_Name, m_eReposInit, HDB_REPOS_OPEN) ;
// Check object exists
if (objId > m_Cache.Count())
return hzerr(E_NOTFOUND, "Beyond Range %u\n", m_Cache.Count()) ;
if (m_eMode & HDB_REPOS_CACHE)
{
if (!m_Cache.Exists(objId))
return E_NOTFOUND ;
// Update the repository delta file
sprintf(dBuf, "@del%u", objId) ;
}
m_osDelta << dBuf ;
m_osDelta.flush() ;
// if (m_bDeletes)
// return E_DELETE ;
// pOld = (char*) mx->m_Objects[objId] ;
// mx->m_Objects.Delete(objId) ;
return E_OK ;
}