| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdsVE::AddChild | (hdsVE*,) |
Declared in file: hzDissemino.h
Defined in file : hdsCore.cpp
Function Logic:
Function body:
hzEcode hdsVE::AddChild (hdsVE* pChild)
{
_hzfunc("hdsVE::AddChild") ;
hdsVE* pVE ;
if (!pChild)
hzexit(E_ARGUMENT, "%s: Null child supplied to Visible Entity", *m_Tag) ;
if (m_flagVE & VE_COMPLETE)
hzexit(E_SEQUENCE, "%s: Visible Entity is already complete, cannot add child %s", *m_Tag, *pChild->m_Tag) ;
if (pChild == this)
hzexit(E_CORRUPT, "%s: Child is same as parent", *m_Tag) ;
if (!pChild->m_VID)
hzexit(E_CORRUPT, "%s: Supplied child (%s) has no ID", *m_Tag, *pChild->m_Tag) ;
if (!m_Children)
{
m_Children = pChild->m_VID ;
}
else
{
pVE = Children() ;
if (pVE->Sibling())
{
for (; pVE && pVE->Sibling() ; pVE = pVE->Sibling())
{
if (pVE == pChild)
return E_OK ;
}
}
if (!pVE)
hzexit(E_CORRUPT, "Last child already had a sibling value") ;
pVE->m_Sibling = pChild->m_VID ;
}
m_nChildren++ ;
return E_OK ;
}