本文整理汇总了C++中wb_object::vid方法的典型用法代码示例。如果您正苦于以下问题:C++ wb_object::vid方法的具体用法?C++ wb_object::vid怎么用?C++ wb_object::vid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wb_object
的用法示例。
在下文中一共展示了wb_object::vid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyObject
wb_object wb_session::copyObject(wb_object o, wb_destination d, wb_name name)
{
wb_orep* orep = 0;
if (isReadonly())
throw wb_error_str("ReadOnlySession");
validateDestination(d, o.cid());
if (evenSts())
throw wb_error(sts());
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);
}
m_sts = triggAnteCreate(parent, o.cid());
if (evenSts())
throw wb_error(sts());
m_sts = triggAnteAdopt(parent, o.cid());
if (evenSts())
throw wb_error(sts());
if (m_vrep->vid() == o.vid()) {
orep = m_vrep->copyObject(&m_sts, (wb_orep*)o, d, name);
if (evenSts())
throw wb_error(sts());
orep->ref();
} else {
wb_cdef c = cdef(o.cid());
orep = m_vrep->createObject(&m_sts, c, d, name);
orep->ref();
wb_attribute rba(o.sts(), (wb_orep*)o, "RtBody");
if (rba) {
void* p = rba.value();
wb_attribute rban(m_sts, orep, "RtBody");
writeAttribute(rban, p);
}
wb_attribute dba(o.sts(), (wb_orep*)o, "DevBody");
if (dba) {
void* p = dba.value();
wb_attribute dban(m_sts, orep, "DevBody");
writeAttribute(dban, p);
}
wb_attribute sba(o.sts(), (wb_orep*)o, "SysBody");
if (sba) {
void* p = sba.value();
wb_attribute sban(m_sts, orep, "SysBody");
writeAttribute(sban, p);
}
}
m_srep->update();
wb_object onew = wb_object(m_sts, orep);
orep->unref();
ldh_sEvent* ep = m_srep->eventStart(onew.oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily(ep, onew);
triggPostCreate(onew);
triggPostAdopt(parent, onew);
m_srep->eventSend(ep);
return onew;
}