本文整理汇总了C++中wb_object::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ wb_object::parent方法的具体用法?C++ wb_object::parent怎么用?C++ wb_object::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wb_object
的用法示例。
在下文中一共展示了wb_object::parent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteFamily
bool wb_session::deleteFamily(wb_object o, bool storeix)
{
if (isReadonly())
throw wb_error_str("ReadOnlySession");
if (!isLocal(o)) {
m_sts = LDH__OTHERVOLUME;
return false;
}
pwr_tStatus sts;
wb_object parent = o.parent();
sts = triggAnteUnadopt(parent, o);
ldh_sEvent* ep = m_srep->eventStart(o.oid(), ldh_eEvent_ObjectDeleted);
m_srep->eventOldFamily(ep, o);
sts = triggPostUnadopt(parent, o);
if (storeix)
m_srep->recix_add(o);
bool rsts = m_vrep->deleteFamily(&m_sts, (wb_orep*)o);
m_srep->update();
m_srep->eventSend(ep);
return rsts;
}
示例2: triggPostMove
pwr_tStatus wb_volume::triggPostMove(wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep(&sts, o.cid());
if (EVEN(sts)) return sts;
cdrep->dbCallBack(&sts, ldh_eDbCallBack_PostMove, &methodName, 0);
delete cdrep;
if (EVEN(sts)) return LDH__SUCCESS;
m_vrep->erep()->method(&sts, methodName, &method);
if (EVEN(sts)) return LDH__SUCCESS;
wb_object father = o.parent();
if (father) {
sts = ((wb_tMethodPostMove) (method))((ldh_tSesContext)this, o.oid(), father.oid(),
father.cid());
}
else
sts = ((wb_tMethodPostMove) (method))((ldh_tSesContext)this, o.oid(), pwr_cNObjid,
pwr_cNClassId);
return sts;
}
示例3: triggPostCreate
pwr_tStatus wb_volume::triggPostCreate(wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
// Call object method, or inherited method
for ( wb_cdef cd = cdef(o.cid()); cd; cd = cd.super()) {
wb_cdrep *cdrep = cd;
cdrep->dbCallBack(&sts, ldh_eDbCallBack_PostCreate, &methodName, 0);
if (ODD(sts)) {
m_vrep->erep()->method(&sts, methodName, &method);
if (EVEN(sts)) return LDH__SUCCESS;
wb_object father = o.parent();
if (father) {
sts = ((wb_tMethodPostCreate) (method))((ldh_tSesContext)this, o.oid(), father.oid(),
father.cid());
}
else
sts = ((wb_tMethodPostCreate) (method))((ldh_tSesContext)this, o.oid(), pwr_cNObjid,
pwr_cNClassId);
return sts;
}
}
return LDH__SUCCESS;
}
示例4: moveObject
bool wb_session::moveObject(wb_object o, wb_destination d)
{
if (isReadonly())
throw wb_error_str("ReadOnlySession");
validateDestination(d, o.cid());
if (evenSts())
return false;
// Check that object is not ancestor to destination
wb_object dest = object(d.oid());
while (dest) {
if (cdh_ObjidIsEqual(dest.oid(), o.oid()))
throw wb_error(LDH__BADDEST);
dest = dest.parent();
}
wb_object parent;
switch (d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object(d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object(d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
wb_object old_parent = o.parent();
m_sts = triggAnteMove(o, parent, old_parent);
if (evenSts())
return false;
m_sts = triggAnteUnadopt(old_parent, o);
if (evenSts())
return false;
m_sts = triggAnteAdopt(parent, o.cid());
if (evenSts())
return false;
ldh_sEvent* ep = m_srep->eventStart(o.oid(), ldh_eEvent_ObjectMoved);
m_srep->eventOldFamily(ep, o);
bool rsts = m_vrep->moveObject(&m_sts, (wb_orep*)o, d);
m_srep->update();
triggPostMove(o);
triggPostUnadopt(old_parent, o);
triggPostAdopt(parent, o);
m_srep->eventNewFamily(ep, o);
m_srep->eventSend(ep);
return rsts;
}
示例5: printHierarchy
//
// printHierarchy
//
void wb_print_wbl::printHierarchy(wb_volume& v, wb_object& o)
{
if (v.object() == o)
indent(1) << "SObject " << v.name() << ":" << endl;
else
indent(1) << "SObject " << o.parent().longName() << endl;
printObject(v, o);
indent(-1) << "EndSObject" << endl;
}
示例6: isAncestor
bool wb_volume::isAncestor(wb_object& ancestor, wb_object& o)
{
if (ancestor.oid().vid != o.oid().vid)
return false;
wb_object p = o.parent();
while (p) {
if (p.oid().oix == ancestor.oid().oix)
return true;
p = p.parent();
}
return false;
}
示例7: eventOldFamily
void wb_srep::eventOldFamily( ldh_sEvent *ep, wb_object o)
{
if ( !m_thisSessionCb)
return;
if (ep == NULL)
return;
wb_object parent = o.parent();
if ( parent)
ep->OldParent = parent.oid();
wb_object before = o.before();
if ( before)
ep->OldLsibling = before.oid();
wb_object after = o.after();
if ( after)
ep->OldRsibling = after.oid();
}
示例8: eventNewFamily
void wb_srep::eventNewFamily( ldh_sEvent *ep, wb_object o)
{
if ( !m_thisSessionCb)
return;
if ( !ep)
return;
wb_object parent = o.parent();
if ( parent)
ep->NewParent = parent.oid();
wb_object before = o.before();
if ( before)
ep->NewLsibling = before.oid();
wb_object after = o.after();
if ( after)
ep->NewRsibling = after.oid();
}