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

C++ pwr_Assert函数代码示例

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

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



在下文中一共展示了pwr_Assert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: lst_IsLinked

pwr_tBoolean
lst_IsLinked (
  thread_sMutex		*mp,
  lst_sEntry		*link
)
{
  pwr_tBoolean		is_linked;
  lst_sEntry		*pred;
  lst_sEntry		*succ;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(checkInit(link));

  pred = link->blink;
  succ = link->flink;
  
  pwr_Assert(check(succ));
  pwr_Assert(check(pred));
  pwr_Assert(pred->flink == link);
  pwr_Assert(succ->blink == link);

  is_linked = link->flink != link;

  if (mp != NULL) sync_MutexUnlock(mp);

  return is_linked;
}
开发者ID:jordibrus,项目名称:proview,代码行数:28,代码来源:rt_lst.c


示例2: lst_InsertSucc

lst_sEntry *
lst_InsertSucc (
  thread_sMutex		*mp,
  lst_sEntry		*pred,		/* Insert after this element */
  lst_sEntry		*link,		/* link to insert */
  void			*item		/* Item to insert */
)
{
  lst_sEntry		*succ;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(checkInit(link));

  succ = pred->flink;
  
  pwr_Assert(check(succ));
  pwr_Assert(check(pred));
  pwr_Assert(succ->blink == pred);

  link->blink = pred;
  link->flink = pred->flink;
  pred->flink = succ->blink = link;
  if (item != NULL)
    link->item = item;

  if (mp != NULL) sync_MutexUnlock(mp);

  return succ;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:30,代码来源:rt_lst.c


示例3: cvolcm_FlushNode

void cvolcm_FlushNode(pwr_tStatus* sts, gdb_sNode* np)
{
  pool_sQlink* vl;
  gdb_sVolume* vp;
  gdb_sCclassVolume* cvp;
  pwr_tStatus lsts;

  gdb_AssumeLocked;
  pwr_Assert(np != gdbroot->my_node && np != gdbroot->no_node);

  for (vl = pool_Qsucc(NULL, gdbroot->pool, &np->own_lh); vl != &np->own_lh;
       vl = pool_Qsucc(NULL, gdbroot->pool, &np->own_lh)) {
    vp = pool_Qitem(vl, gdb_sVolume, l.own_ll);
    pwr_Assert(vp->l.flags.b.isCached);
    if (vp->l.flags.b.isCached)
      cvolcm_FlushVolume(NULL, vp);
  }

  for (vl = pool_Qsucc(NULL, gdbroot->pool, &np->ccvol_lh); vl != &np->ccvol_lh;
       vl = pool_Qsucc(NULL, gdbroot->pool, &np->ccvol_lh)) {
    cvp = pool_Qitem(vl, gdb_sCclassVolume, ccvol_ll);

    hash_Remove(&lsts, gdbroot->ccvol_ht, cvp);
    if (EVEN(lsts))
      errh_Bugcheck(lsts, "cached class volume inconsistency");

    pool_Qremove(NULL, gdbroot->pool, &cvp->ccvol_ll);
    pool_Free(NULL, gdbroot->pool, cvp);
  }
}
开发者ID:siamect,项目名称:proview,代码行数:30,代码来源:rt_cvolcm.c


示例4: lst_InsertPred

lst_sEntry *
lst_InsertPred (
  thread_sMutex		*mp,
  lst_sEntry		*succ,		/* Insert before this element */
  lst_sEntry		*link,		/* Link to insert */
  void			*item		/* Item to insert */
)
{
  lst_sEntry		*pred;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(checkInit(link));

  pred = succ->blink;
  
  pwr_Assert(check(succ));
  pwr_Assert(check(pred));
  pwr_Assert(pred->flink == succ);

  link->flink = succ;
  link->blink = succ->blink;
  succ->blink = pred->flink = link;
  if (item != NULL)
    link->item = item;

  if (mp != NULL) sync_MutexUnlock(mp);

  return pred;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:30,代码来源:rt_lst.c


示例5: lst_IsSucc

pwr_tBoolean
lst_IsSucc (
  thread_sMutex		*mp,
  lst_sEntry		*pred,
  lst_sEntry		*link
)
{
  lst_sEntry		*succ;
  pwr_tBoolean		is_succ;

  if (mp != NULL) sync_MutexLock(mp);

  pwr_Assert(check(pred));
  pwr_Assert(check(link));


  succ = link->flink;
  
  if (succ != NULL) {
    pwr_Assert(check(succ));
    pwr_Assert(succ->blink == link);
    pwr_Assert(link->flink == succ);
  }

  is_succ = pred->flink == link;

  if (mp != NULL) sync_MutexUnlock(mp);

  return is_succ;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:30,代码来源:rt_lst.c


示例6: dbs_Qinsert

dbs_sQlink *
dbs_Qinsert(pwr_tStatus *sts, dbs_sQlink *pred, dbs_sQlink *item, dbs_sQlink *succ)
{

    pwr_Assert(pred->succ == succ->self);
    pwr_Assert(succ->pred == pred->self);

    pred->succ = succ->pred = item->self;
    item->pred = pred->self;
    item->succ = succ->self;

    return item;
}
开发者ID:jordibrus,项目名称:proview,代码行数:13,代码来源:co_dbs.c


示例7: dbs_QisNull

pwr_tBoolean
dbs_QisNull(pwr_tStatus *sts, const dbs_sVenv *vep, dbs_sQlink *item)
{
    pwr_tBoolean nullQ;

    nullQ = (item->self == dbs_cNref)
        || (item->pred == dbs_cNref)
        || (item->succ == dbs_cNref);
  
    pwr_Assert(item->pred == dbs_cNref);
    pwr_Assert(item->succ == dbs_cNref);
    pwr_Assert(item->self  == dbs_cNref);

    return nullQ;
}
开发者ID:jordibrus,项目名称:proview,代码行数:15,代码来源:co_dbs.c


示例8: subs_UnlinkObject

void
subs_UnlinkObject (
  gdb_sObject		*op
)
{
  sub_sServer		*sp;
  pool_sQlink		*sl;
  
  gdb_AssumeLocked;

  for (
    sl = pool_Qsucc(NULL, gdbroot->pool, &gdbroot->db->subs_lh);
    sl != &gdbroot->db->subs_lh;
  ) {
    sp = pool_Qitem(sl, sub_sServer, subs_ll);
    if (cdh_ObjidIsEqual(sp->aref.Objid, op->g.oid)) {
      sp->data	= pool_cNRef;
      sp->sts	= GDH__NOSUCHOBJ;

      if ( op->u.n.subcount > 0) /* Subscriptions on invalid offset will allocate buffer without increasing count */
	op->u.n.subcount--;
    }
  }

  pwr_Assert(op->u.n.subcount == 0);

}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:27,代码来源:rt_subs.c


示例9: subs_UnlinkObject

void
subs_UnlinkObject (
    gdb_sObject		*op
)
{
    sub_sServer		*sp;
    pool_sQlink		*sl;

    gdb_AssumeLocked;

    for (
        sl = pool_Qsucc(NULL, gdbroot->pool, &gdbroot->db->subs_lh);
        sl != &gdbroot->db->subs_lh;
    ) {
        sp = pool_Qitem(sl, sub_sServer, subs_ll);
        if (cdh_ObjidIsEqual(sp->aref.Objid, op->g.oid)) {
            sp->data	= pool_cNRef;
            sp->sts	= GDH__NOSUCHOBJ;

            op->u.n.subcount--;
        }
    }

    pwr_Assert(op->u.n.subcount == 0);

}
开发者ID:hfuhuang,项目名称:proview,代码行数:26,代码来源:rt_subs.c


示例10: cvolcm_ExternVolumeFlush

void cvolcm_ExternVolumeFlush(gdb_sNode* np)
{
  pool_sQlink* vl;
  gdb_sVolume* vp;
  pool_sQlink* ol;
  gdb_sObject* op;
  gdb_sMountServer* msp;
  pwr_tStatus sts;

  // Flush local node
  gdb_AssumeLocked;

  for (vl = pool_Qsucc(NULL, gdbroot->pool, &np->own_lh); vl != &np->own_lh;
       vl = pool_Qsucc(NULL, gdbroot->pool, vl)) {
    vp = pool_Qitem(vl, gdb_sVolume, l.own_ll);
    pwr_Assert(vp->l.flags.b.isCached);
    if (vp->l.flags.b.isCached) {
      for (ol = pool_Qsucc(NULL, gdbroot->pool, &vp->l.obj_lh);
           ol != &vp->l.obj_lh;
           ol = pool_Qsucc(NULL, gdbroot->pool, &vp->l.obj_lh)) {
        op = pool_Qitem(ol, gdb_sObject, l.obj_ll);
        if (op->l.flags.b.isMountServer) {
          msp = (gdb_sMountServer*)hash_Search(
              &sts, gdbroot->ms_ht, &op->g.oid);
          if (msp == NULL)
            errh_Bugcheck(sts, "mount server inconsitency");
          msp->msor = pool_cNRef;
          pool_Qremove(NULL, gdbroot->pool, &msp->nodms_ll);
          /* Todo !!! Clear alarm and blocklevel in all mount clients. */
        }
        cvol_FlushObject(op);
      }
    }
  }
}
开发者ID:siamect,项目名称:proview,代码行数:35,代码来源:rt_cvolcm.c


示例11: ivol_BuildVolume

pwr_tBoolean
ivol_BuildVolume (
  pwr_tStatus		*status,
  gdb_sVolume		*vp
)
{
  pool_sQlink		*ol;
  gdb_sObject		*op;

  pwr_dStatus(sts, status, GDH__SUCCESS);

  /* First link the volume block.  */


  /* Now link all objects.  */

  for (
    ol = pool_Qsucc(sts, gdbroot->pool, &vp->l.obj_lh);
    ol != &vp->l.obj_lh;
    ol = pool_Qsucc(sts, gdbroot->pool, ol)
  ) {
    op = pool_Qitem(ol, gdb_sObject, l.obj_ll);

    vol_LinkObject(sts, vp, op, vol_mLink_build);
    pwr_Assert(ODD(*sts));

  }
  return YES;
}
开发者ID:Strongc,项目名称:proview,代码行数:29,代码来源:rt_ivol.c


示例12: buildScObjects

static pwr_tBoolean
buildScObjects (
  pwr_tStatus		*status,
  gdb_sVolume		*vp
)
{
  pool_sQlink		*scl;
  gdb_sScObject		*scp;

  pwr_dStatus(sts, status, GDH__SUCCESS); 

  /* Link all sc objects.  */

  for (
    scl = pool_Qsucc(sts, gdbroot->pool, &vp->u.n.sc_lh);
    scl != &vp->u.n.sc_lh;
    scl = pool_Qsucc(sts, gdbroot->pool, scl)
  ) {
    scp = pool_Qitem(scl, gdb_sScObject, sc_ll);

    vol_LinkScObject(sts, vp, scp, vol_mLinkSc_build);
    pwr_Assert(ODD(*sts));

  }
  return YES;
}
开发者ID:Strongc,项目名称:proview,代码行数:26,代码来源:rt_ivol.c


示例13: mountClients

static pwr_tBoolean
mountClients (
  pwr_tStatus		*sts,
  gdb_sVolume		*vp
)
{
  pool_sQlink		*ol;
  gdb_sObject		*op;

  /* First link the volume block.  */


  /* Now link all objects.  */

  for (
    ol = pool_Qsucc(sts, gdbroot->pool, &vp->l.obj_lh);
    ol != &vp->l.obj_lh;
    ol = pool_Qsucc(sts, gdbroot->pool, ol)
  ) {
    op = pool_Qitem(ol, gdb_sObject, l.obj_ll);

    if (op->g.flags.b.isMountClient && op->g.oid.vid == gdbroot->db->vid) {
      /* Only root volumes can mount.  */
      mountVolume(sts, op);
      if ( *sts != GDH__NOMOUNTOBJECT)
	pwr_Assert(ODD(*sts));
    }
  }
  return YES;
}
开发者ID:Strongc,项目名称:proview,代码行数:30,代码来源:rt_ivol.c


示例14: time_Uptime

pwr_tDeltaTime *
time_Uptime (
  pwr_tStatus	  *status,
  pwr_tDeltaTime  *tp,
  pwr_tDeltaTime  *ap
)
{
  pwr_tDeltaTime  time;
  long		  tics;
  void		  *argv[2];

  pwr_dStatus(sts, status, TIME__SUCCESS);

  if (tp == NULL)
    tp = &time;

  argv[0] = (void *) 1;
  argv[1] = &tics;

  *sts = sys$cmexec(&uptime, argv);

  tp->tv_sec = tics / 100;
  tp->tv_nsec = (tics % 100) * 10000000;

  pwr_Assert(tp->tv_sec >= 0 && tp->tv_nsec >= 0);

  if (ap != NULL)
    return time_Dadd(tp, tp, ap);
  else
    return tp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:31,代码来源:co_time_spec.c


示例15: time_Adiff

pwr_tDeltaTime *
time_Adiff (
  pwr_tDeltaTime  *r,
  pwr_tTime   *t,
  pwr_tTime   *s
)
{
  pwr_tInt64     tv_nsec = t->tv_nsec - s->tv_nsec;
  pwr_tInt64     tv_sec  = t->tv_sec  - s->tv_sec;

  pwr_Assert(r != NULL);
  assertAbs(t);
  assertAbs(s);

  tv_sec  = tv_sec + tv_nsec / 1000000000;
  tv_nsec = tv_nsec % 1000000000;
  if (tv_nsec < 0 && tv_sec > 0) {
    tv_sec--;
    tv_nsec += 1000000000;
  } else if (tv_sec < 0 && tv_nsec > 0) {
    tv_sec++;
    tv_nsec -= 1000000000;
  }

  r->tv_sec = tv_sec;
  r->tv_nsec = tv_nsec;

  return r;
}
开发者ID:jordibrus,项目名称:proview,代码行数:29,代码来源:co_time.c


示例16: create_thread

static void
create_thread (
  plc_sThread	*tp,
  plc_sProctbl	*ptp,
  plc_sProcess	*pp
)
{
  pwr_tStatus	sts;
  long int phase;

  tp->aref.Objid = ptp->thread;
  tp->init = ptp->init;
  tp->exec = ptp->exec;
  tp->first_scan = 1;

  tp->PlcThread = pwrb_PlcThread_Init(&sts, tp);
  tp->csup_lh = csup_Init(&sts, ptp->thread, tp->f_scan_time);

  tp->i_scan_time = tp->f_scan_time * 1000.0 + 0.5;

  time_FloatToD(&tp->scan_time, tp->f_scan_time);

  tp->pp = pp;
 
  plc_inittimer(tp);
  tp->exit = FALSE;
  link_io_copy_areas(tp);

  que_Create(&sts, &tp->q_in);
  que_Create(&sts, &tp->q_out);

  sts = gdh_ObjidToName(ptp->thread, tp->name, sizeof(tp->name), cdh_mNName);
  if (EVEN(sts)) {
    errh_Error("Get name of thread object %s, %m", cdh_ObjidToString(NULL, ptp->thread, 1), sts);
    return;
  }

  sts = gdh_ObjidToPointer(ptp->thread, (void *)&tp->PlcThread);
  if (EVEN(sts)) {
    errh_Error("Direct link to thread object \"%s\", %m", tp->name, sts);
    return;
  }

#if defined OS_LYNX && USE_RT_TIMER
  sem_init(&tp->ScanSem, 0, 0);
  tp->ScanMultiple = tp->i_scan_time / (CLK_TCK/1000);
  tp->IntervalCount = tp->ScanMultiple; 
#endif


  sts = thread_Create(&tp->tid, tp->name, (void *(*)())&plc_thread, tp);
  if (EVEN(sts)) {
    errh_Error("Creating thread \"%s\", %m", tp->name, sts);
    return;
  }

  /* Wait for thread to initialize.  */
  phase = (long int)que_Get(&sts, &tp->q_out, NULL, NULL);
  pwr_Assert(phase == 1);
}
开发者ID:hfuhuang,项目名称:proview,代码行数:60,代码来源:rt_plc_process.c


示例17: cvolcm_AddClassVolume

/**
 * Adds a remote class volume.
 */
void cvolcm_AddClassVolume(
    pwr_tStatus* sts, gdb_sNode* np, const net_sGvolume* vp)
{
  gdb_sCclassVolume *ccvp, *rp;
  gdb_sVolume* cvp;

  gdb_AssumeLocked;
  pwr_Assert(vp != NULL);

  ccvp = pool_Alloc(sts, gdbroot->pool, sizeof(*ccvp));
  if (ccvp == NULL)
    return;

  ccvp->key.nid = vp->nid;
  ccvp->key.vid = vp->vid;
  ccvp->time = net_NetTimeToTime(&vp->time);

  cvp = hash_Search(sts, gdbroot->vid_ht, &vp->vid);
  if (cvp == NULL) /* This volume doesn't exist locally, but we may create it
                      later on */
    ccvp->equalClasses = 0;
  else {
    pwr_tTime t = net_NetTimeToTime(&cvp->g.time);
    ccvp->equalClasses = time_Acomp(&ccvp->time, &t) == 0 ? 1 : 0;
  }

  rp = hash_Insert(sts, gdbroot->ccvol_ht, ccvp);
  if (rp == NULL) { /* This was previously a bugcheck but obviously can occur */
    pool_Free(NULL, gdbroot->pool, ccvp);
    return;
  }

  pool_QinsertPred(NULL, gdbroot->pool, &ccvp->ccvol_ll, &np->ccvol_lh);
}
开发者ID:siamect,项目名称:proview,代码行数:37,代码来源:rt_cvolcm.c


示例18: dbs_Qpred

dbs_sQlink *
dbs_Qpred(pwr_tStatus *sts, const dbs_sVenv *vep, dbs_sQlink *item)
{
    dbs_sQlink *pred;

    pwr_Assert(checkQ(vep, item));

    pred = dbs_Address(NULL, vep, item->pred);
  
    if (pred != NULL) {
        pwr_Assert(checkQ(vep, pred));
        pwr_Assert(pred->succ == item->self);
        pwr_Assert(pred->self == item->pred);
    }

    return pred;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:17,代码来源:co_dbs.c


示例19: dbs_Qsucc

dbs_sQlink *
dbs_Qsucc(pwr_tStatus *sts, const dbs_sVenv *vep, dbs_sQlink *item)
{
    dbs_sQlink *succ;

    pwr_Assert(checkQ(vep, item));

    succ = dbs_Address(NULL, vep, item->succ);
  
    if (succ != NULL) {
        pwr_Assert(checkQ(vep, succ));
        pwr_Assert(succ->pred == item->self);
        pwr_Assert(item->succ == succ->self);
    }

    return succ;  
}
开发者ID:jordibrus,项目名称:proview,代码行数:17,代码来源:co_dbs.c


示例20: dl_Create

dl_sLink *
dl_Create (
  pwr_tStatus		*sts,
  mvol_sAttribute	*ap,
  pwr_sAttrRef		*arp
)
{
  pwr_tStatus		lsts;
  dl_sLink		*dp;
  dl_sLink		*rdp;

  gdb_AssumeLocked;

  pwr_Assert(ap != NULL);
  pwr_Assert(ap->op != NULL);
  pwr_Assert(arp != NULL);

  dp = pool_Alloc(NULL, gdbroot->pool, sizeof(dl_sLink));

  do {
    gdbroot->db->dlid.rix++;
    dp->dlid = gdbroot->db->dlid;

    rdp = hash_Insert(&lsts, gdbroot->subc_ht, dp);
    if (rdp != dp && lsts != HASH__DUPLICATE)
      errh_Bugcheck(lsts, "hash_Insert");
  } while (rdp != dp);

  dp->user = gdbroot->my_pid;
  dp->aref = *arp;
  dp->opr   = pool_ItemReference(NULL, gdbroot->pool, ap->op);


  /* Lock the object */

  gdb_LockObject(sts, ap->op);

  /* Insert in list of direct links */

  pool_QinsertSucc(NULL, gdbroot->pool, &dp->dl_ll, &gdbroot->db->dl_lh);
  gdbroot->db->dl_lc++;

  return dp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:44,代码来源:rt_dl.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ pwr_BindMethod函数代码示例发布时间:2022-05-30
下一篇:
C++ pwmout_write函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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