• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wb_object类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中wb_object的典型用法代码示例。如果您正苦于以下问题:C++ wb_object类的具体用法?C++ wb_object怎么用?C++ wb_object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wb_object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
  }
}
开发者ID:jordibrus,项目名称:proview,代码行数:32,代码来源:wb_upgrade.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:30,代码来源:wb_volume.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:26,代码来源:wb_volume.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:32,代码来源:wb_volume.cpp


示例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;
}
开发者ID:siamect,项目名称:proview,代码行数:26,代码来源:wb_session.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:28,代码来源:wb_volume.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:13,代码来源:wb_volume.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:51,代码来源:wb_volume.cpp


示例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);
    }
  }
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:44,代码来源:wb_volume.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:19,代码来源:wb_volume.cpp


示例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;
}
开发者ID:Strongc,项目名称:proview,代码行数:14,代码来源:wb_print_wbl.cpp


示例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;
}
开发者ID:jordibrus,项目名称:proview,代码行数:11,代码来源:wb_c_plcpgm.cpp


示例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();
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:21,代码来源:wb_srep.cpp


示例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();
  
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:22,代码来源:wb_srep.cpp


示例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;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:23,代码来源:wb_volume.cpp


示例16: renameObject

bool wb_session::renameObject(wb_object o, wb_name name)
{
  m_sts = LDH__SUCCESS;

  if (isReadonly())
    throw wb_error_str("ReadOnlySession");

  bool ok = m_vrep->renameObject(&m_sts, (wb_orep*)o, name);
  if (!ok)
    return ok;

  triggPostRename(o);

  m_srep->update();
  ldh_sEvent* ep = m_srep->eventStart(o.oid(), ldh_eEvent_ObjectRenamed);
  m_srep->eventSend(ep);
  return ok;
}
开发者ID:siamect,项目名称:proview,代码行数:18,代码来源:wb_session.cpp


示例17: indent

//
// printObject
//
void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
{
  wb_object to = o;
  wb_object templ;
  cdh_uObjid	uid;
  unsigned int idx;
  wb_cdef cdef = v.cdef(o);
  if ( !cdef) {
    m_os << "! %WBDUMP-E-Error Failed to get object class" << endl;
    m_errCnt++;
    // return;
    cdef = v.cdef( pwr_eClass_ClassLost);
  }
  const char* cname = cdef.name();
  char *block;
  int size;

  if ( o.docBlock( &block, &size) && strcmp( block, "") != 0) {
    indent(0) << "!/**" << endl;
    indent(0) << "! ";
    for ( char *s = block; *s; s++) {
      if ( *s == '\n') {
	m_os << *s;
	indent(0) << "! ";
	continue;
      }
      m_os << *s;
    }
    m_os << endl;
    indent(0) << "!*/" << endl;
  }

  indent(1) << "Object " << o.name() << " " << cname;

  if (m_idxFlag) {
    switch (cdef.cid()) {
    case pwr_eClass_ClassDef:
      uid.pwr = o.oid();
      idx = uid.c.cix;
      break;
    case pwr_eClass_TypeDef:
      uid.pwr = o.oid();
      idx = uid.t.tix;
      break;
    case pwr_eClass_ObjBodyDef:
      uid.pwr = o.oid();
      idx = uid.c.bix;
      break;
    case pwr_eClass_Param:
    case pwr_eClass_Input:
    case pwr_eClass_Output:
    case pwr_eClass_Intern:
    case pwr_eClass_Buffer:
    case pwr_eClass_ObjXRef:
      uid.pwr = o.oid();
      idx = uid.c.aix;
      break;
    default:
      idx = (unsigned long) o.oix();
    }
    m_os << " " << idx;
  }
  if ( m_timeFlag) {
    // Get oh time
    char timestr[40];
    pwr_tTime ohtime = o.ohTime();
    time_AtoAscii( &ohtime, time_eFormat_DateAndTime, timestr, sizeof(timestr));

    m_os << " " << timestr;
  }
  m_os << endl;

  wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid()));
  wb_name t("Template");
  
  templ = co.child(t);
  if (!templ) {
    m_errCnt++;
    m_os << "Template not found for class " << cdef.name() << endl;
    return;
  }

  if ( v.cid() == pwr_eClass_ClassVolume &&
       strcmp( o.name(), "Template") == 0)
    m_isTemplateObject = true;
  else
    m_isTemplateObject = false;
  
 
  printBody(v, o, templ, cdef, pwr_eBix_rt);
  printBody(v, o, templ, cdef, pwr_eBix_dev);

  if (recursive) {
    if ( !(m_noFoCodeFlag && isFoCodeObject( v, o))) {
      for (to = o.first(); to; to = to.after())
	printObject(v, to);
    }
//.........这里部分代码省略.........
开发者ID:Strongc,项目名称:proview,代码行数:101,代码来源:wb_print_wbl.cpp


示例18: printBody

//
// printBody
//
void wb_print_wbl::printBody(wb_volume& v, 
                             wb_object& o, 
                             wb_object& templ,
                             wb_cdef& cdef,
                             pwr_eBix bix)
{
  wb_adef adef;
  wb_attribute attr;
  wb_attribute tattr;
  const char* bname;
  char timestr[40] = " ";
  int force = 0;
    
  wb_bdef bdef = cdef.bdef(bix);
    

  if (!bdef)
    return;

  bname = bdef.name();

  wb_bdef tbdef = templ.bdef(bix);
  if (!tbdef) {
    m_errCnt++;
    m_os << "Couldn't find template body def for object " << o.name() << endl;
    return;
  }
    
  if ( m_timeFlag) {
    // Get body time
    pwr_tTime btime;
    switch ( bix) {
    case pwr_eBix_rt:
      btime = o.rbTime();

      // Bugcheck in 4.2 btime can be corrupt
      if ( btime.tv_nsec < 0 || btime.tv_nsec >= 1000000000)
	break;

      strcpy( timestr, " ");
      time_AtoAscii( &btime, time_eFormat_DateAndTime, &timestr[1], sizeof(timestr)-1);
      break;
    case pwr_eBix_dev:
      btime = o.dbTime();
      strcpy( timestr, " ");
      time_AtoAscii( &btime, time_eFormat_DateAndTime, &timestr[1], sizeof(timestr)-1);
      break;
    default: ;
    }
  }

  indent(1) << "Body " << bdef.name() << timestr << endl;
  for (adef = bdef.adef(); adef; adef = adef.next()) {
    if ( cdef.cid() == pwr_eClass_Param && strcmp( adef.name(), "Size") == 0) {
      // Print Size for Pointers that is not private
      wb_attribute flags_attr = o.attribute(bname, "Flags");
      pwr_tMask *flagsp = (pwr_tMask *)flags_attr.value();
      if (*flagsp & PWR_MASK_POINTER && !(*flagsp & PWR_MASK_PRIVATE))
	force = 1;
    }

    attr = o.attribute(bname, adef.name());
    tattr = templ.attribute(bname, adef.name());
    //    if (tattr == attr)
    //  continue;
    printAttribute(v, attr, tattr, adef, force);
  }

  indent(-1) << "EndBody" << endl;
    
  return;
}
开发者ID:Strongc,项目名称:proview,代码行数:75,代码来源:wb_print_wbl.cpp


示例19:

wb_destination::wb_destination(wb_object &o, ldh_eDest code) :
  m_oid(o.oid()), m_code(code)
{    
}
开发者ID:Strongc,项目名称:proview,代码行数:4,代码来源:wb_destination.cpp


示例20: wb_status

wb_object::wb_object(const wb_object& x) : wb_status(x.sts()), m_orep(x.m_orep)
{
  if (m_orep)
    m_orep->ref();
}
开发者ID:siamect,项目名称:proview,代码行数:5,代码来源:wb_object.cpp



注:本文中的wb_object类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wcstring类代码示例发布时间:2022-05-31
下一篇:
C++ wait_list类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap