本文整理汇总了C++中wb_object类的典型用法代码示例。如果您正苦于以下问题:C++ wb_object类的具体用法?C++ wb_object怎么用?C++ wb_object使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wb_object类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
static void process( wb_session& session, wb_object& o)
{
pwr_sPlcNode plcnode;
if ( o.cid() == pwr_cClass_csub) {
printf ( "Object: %s\n", o.longName().c_str());
wb_attribute a = session.attribute( o.oid(), "DevBody", "PlcNode");
if ( !a) exit(0);
a.value( &plcnode);
printf( "subwindow: %d, woid: %u,%u\n", plcnode.subwindow,
plcnode.subwind_oid[0].vid, plcnode.subwind_oid[0].oix);
wb_object c = o.first();
if ( c && c.cid() == pwr_cClass_windowplc) {
plcnode.subwind_oid[0].vid = c.oid().vid;
plcnode.subwind_oid[0].oix = c.oid().oix;
printf( "subwindow: %d, woid: %u,%u\n", plcnode.subwindow,
plcnode.subwind_oid[0].vid, plcnode.subwind_oid[0].oix);
session.writeAttribute( a, &plcnode, sizeof(plcnode));
if ( !a) cout << "** Write error" << endl;
}
}
for ( wb_object c = o.first(); c.oddSts(); c = c.after()) {
process( session, c);
}
}
示例2: 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;
}
示例3: 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;
}
示例4: triggAnteMove
pwr_tStatus wb_volume::triggAnteMove(wb_object& o, wb_object& father, wb_object& old_father)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
pwr_tOid foid;
pwr_tOid old_foid;
wb_cdrep *cdrep = m_vrep->merep()->cdrep(&sts, o.cid());
if (EVEN(sts)) return sts;
cdrep->dbCallBack(&sts, ldh_eDbCallBack_AnteMove, &methodName, 0);
delete cdrep;
if (EVEN(sts)) return LDH__SUCCESS;
m_vrep->erep()->method(&sts, methodName, &method);
if (EVEN(sts)) return LDH__SUCCESS;
if (father)
foid = father.oid();
else
foid = pwr_cNObjid;
if (old_father)
old_foid = old_father.oid();
else
old_foid = pwr_cNObjid;
sts = ((wb_tMethodAnteMove) (method))((ldh_tSesContext)this, o.oid(), foid,
old_foid);
return sts;
}
示例5: wb_error_str
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;
}
示例6: triggAnteAdopt
pwr_tStatus wb_volume::triggAnteAdopt(wb_object& father, pwr_tCid cid)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
pwr_tOid foid;
if (!father)
return LDH__SUCCESS;
wb_cdrep *cdrep = m_vrep->merep()->cdrep(&sts, father.cid());
if (EVEN(sts)) return sts;
cdrep->dbCallBack(&sts, ldh_eDbCallBack_AnteAdopt, &methodName, 0);
delete cdrep;
if (EVEN(sts)) return LDH__SUCCESS;
m_vrep->erep()->method(&sts, methodName, &method);
if (EVEN(sts)) return LDH__SUCCESS;
if (!father)
foid = pwr_cNObjid;
else
foid = father.oid();
sts = ((wb_tMethodAnteAdopt) (method))((ldh_tSesContext)this, foid, cid);
return sts;
}
示例7: 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;
}
示例8: a
pwr_tStatus wb_volume::syntaxCheckObject(wb_object& o, int *errorcount, int *warningcount)
{
pwr_tStatus sts, csts;
wb_object first, after;
wb_attribute a(o.sts(), o);
sts = triggSyntaxCheck(a, errorcount, warningcount);
if (EVEN(sts)) return sts;
// Get any attribute objects
wb_cdef cd = cdef(o);
if ( !cd) return cd.sts();
wb_bdef bdef = cd.bdef(pwr_eBix_rt);
wb_adef adef;
if ( bdef) {
for (adef = bdef.adef(); adef; adef = adef.next()) {
if ( !(adef.flags() & PWR_MASK_CLASS))
continue;
if ( adef.flags() & PWR_MASK_ARRAY) {
for ( int i = 0; i < adef.nElement(); i++) {
wb_attribute a( adef.sts(), o, adef, i);
csts = syntaxCheckAttr( a, errorcount, warningcount);
if ( EVEN(csts)) sts = csts;
}
}
else {
wb_attribute a( adef.sts(), o, adef);
if ( adef.flags() & PWR_MASK_DISABLEATTR && a.disabled())
continue;
csts = syntaxCheckAttr( a, errorcount, warningcount);
if ( EVEN(csts)) sts = csts;
}
}
}
for ( wb_object c = o.first(); c; c = c.after()) {
if ( c.cid() == pwr_eClass_LibHier)
continue;
csts = syntaxCheckObject(c, errorcount, warningcount);
if ( EVEN(csts))
sts = csts;
}
return sts;
}
示例9: aref
void wb_volume::aref(pwr_tCid cid, wb_object o, pwr_sAttrRef *arp)
{
tree_sTable *catt_tt = m_vrep->merep()->buildCatt(&m_sts);
merep_sClassAttrKey key;
merep_sClassAttr *item;
key.subCid = cid;
key.hostCid = o.cid();
key.idx = 0;
item = (merep_sClassAttr *) tree_Find(&m_sts, catt_tt, &key);
if (item == NULL) {
m_sts = LDH__CLASSLIST;
return;
}
wb_cdrep *cd = m_vrep->merep()->cdrep(&m_sts, cid);
if (evenSts()) return;
int bd_size;
wb_bdrep *bd = cd->bdrep(&m_sts, pwr_eBix_rt);
if (oddSts()) {
bd_size = bd->size();
delete bd;
}
else
bd_size = 0;
delete cd;
*arp = pwr_cNAttrRef;
arp->Objid = o.oid();
arp->Flags.b.ObjectAttr = 1;
arp->Offset = item->offset[0];
arp->Size = bd_size;
arp->Body = cdh_cidToBid( cid, pwr_eBix_rt);
if (item->flags[0] & PWR_MASK_DISABLEATTR) {
wb_attribute a = attribute(arp);
if (a.disabled()) {
pwr_sAttrRef aref = *arp;
nextObjectAref(cid, &aref, arp);
}
}
}
示例10: triggPostRename
pwr_tStatus wb_volume::triggPostRename(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_PostRename, &methodName, 0);
delete cdrep;
if (EVEN(sts)) return LDH__SUCCESS;
m_vrep->erep()->method(&sts, methodName, &method);
if (EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodPostRename) (method))((ldh_tSesContext)this, o.oid());
return sts;
}
示例11: 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;
}
示例12: CheckChildCid
static bool CheckChildCid( wb_object &o, pwr_tCid cid)
{
for ( wb_object child = o.first(); child; child = child.after()) {
if ( child.cid() == cid) {
return true;
}
if ( CheckChildCid( child, cid))
return true;
}
return false;
}
示例13: 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();
}
示例14: 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();
}
示例15: triggAnteUnadopt
pwr_tStatus wb_volume::triggAnteUnadopt(wb_object& father, wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
if (!father)
return LDH__SUCCESS;
wb_cdrep *cdrep = m_vrep->merep()->cdrep(&sts, father.cid());
if (EVEN(sts)) return sts;
cdrep->dbCallBack(&sts, ldh_eDbCallBack_AnteUnadopt, &methodName, 0);
delete cdrep;
if (EVEN(sts)) return LDH__SUCCESS;
m_vrep->erep()->method(&sts, methodName, &method);
if (EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodAnteUnadopt) (method))((ldh_tSesContext)this, father.oid(), o.oid(),
o.cid());
return sts;
}