Locate the external repository associated with a subclass member. This will either be the repository itself or that specified during initialization InitMbrRepos() Pointer to the external repository if found, 0 otherwise
| Return Type | Function name | Arguments |
|---|---|---|
| hdbObjRepos* | hdbObjRepos::ObjRepos | (hdbMember*,) |
Declared in file: hzDatabase.h
Defined in file : hdbObjRepos.cpp
Function Logic:
Function body:
hdbObjRepos* hdbObjRepos::ObjRepos (hdbMember* pMbr)
{
// Locate the external repository associated with a subclass member. This will either be the repository itself or that specified during initialization InitMbrRepos()
//
// Argument: pMbr Data class member
//
// Returns: Pointer to the external repository if found, 0 otherwise
_hzfunc("hdbObjRepos::ObjRepos") ;
const hdbObjRepos* pR ; // Binary repos
if (!m_pClass) { hzerr(E_NOINIT, "No data class") ; return 0; }
if (!pMbr) { hzerr(E_NOINIT, "No member supplied") ; return 0; }
if (pMbr->Class() != m_pClass)
{ hzerr(E_CORRUPT, "Member %s not in class %s", pMbr->txtName(), m_pClass->txtName()) ; return 0; }
if (pMbr->Basetype() != BASETYPE_CLASS)
{ hzerr(E_TYPE, "Member %s is not BINARY or TXTDOC", pMbr->txtName()) ; return 0; }
pR = m_mapRepos[pMbr->Posn()] ;
if (!pR)
return this ;
return pR ;
}