当前位置: 首页>>代码示例>>C++>>正文


C++ ellFirst函数代码示例

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


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

示例1: init_unpack

/*
 *  read configuration sent by scanner and populate "config" in
 *  ENGINE_USER structure
 */
static int init_unpack(ENGINE_USER * usr, char * buffer, int size)
{
    EC_CONFIG * cfg = usr->config;
    int ofs = 0;
    int tag = unpack_int(buffer, &ofs);
    assert(tag == MSG_CONFIG);
    int scanner_config_size = unpack_int(buffer, &ofs);
    read_config(buffer + ofs, scanner_config_size, cfg);
    ofs += scanner_config_size;
    int mapping_config_size = unpack_int(buffer, &ofs);
    parseEntriesFromBuffer(buffer + ofs, mapping_config_size, cfg);

    ELLNODE * node;
    for(node = ellFirst(&cfg->devices); node; node = ellNext(node))
    {
        EC_DEVICE * device = (EC_DEVICE *)node;
        printf("%s\n", device->name);
        ELLNODE * node1;
        for(node1 = ellFirst(&device->pdo_entry_mappings); node1; node1 = ellNext(node1))
        {
            EC_PDO_ENTRY_MAPPING * mapping = (EC_PDO_ENTRY_MAPPING *)node1;
            if(strcmp(mapping->pdo_entry->name, mapping->pdo_entry->parent->name) == 0)
            {
                printf("  %s\n", mapping->pdo_entry->name);
            }
            else
            {
                printf("  %s %s\n", mapping->pdo_entry->parent->name, mapping->pdo_entry->name);
            }
        }
    }
    return 0;
}
开发者ID:ronaldomercado,项目名称:ethercat,代码行数:37,代码来源:ecAsyn.cpp

示例2: show

void show(CONTEXT * ctx)
{
    printf("== show == \n");
    printf("device types %d\n", ctx->config->device_types.count);
    ELLNODE * node;
    for(node = ellFirst(&ctx->config->device_types); node; node = ellNext(node))
    {
        EC_DEVICE_TYPE * device_type = 
          (EC_DEVICE_TYPE *)node;
        printf("name %s, ", device_type->name);
        printf(" (vendor %x, product %x, revision %d) ",
               device_type->vendor_id, device_type->product_id,
               device_type->revision_id);
        printf("sync managers %d\n", device_type->sync_managers.count);
    }
    printf("device instances %d\n", ctx->config->devices.count);
    for(node = ellFirst(&ctx->config->devices); node; node = ellNext(node))
    {
        EC_DEVICE * device = (EC_DEVICE *)node;
        printf("name %s position %d\n", device->name, device->position);
        printf("simulation specs %d\n", device->simspecs.count);
        ELLNODE * node1 = ellFirst(&device->simspecs);
        for (;node1; node1 = ellNext(node1) )
        {
            st_simspec * simspec = (st_simspec *) node1;
            printf("simspec signal_no %d type %d bit_length %d\n", 
                  simspec->signal_no, simspec->type, simspec->bit_length);
        }
    
    }
}
开发者ID:ronaldomercado,项目名称:ethercat,代码行数:31,代码来源:parser.c

示例3: serialize_config

char * serialize_config(EC_CONFIG * cfg)
{
    /* serialize PDO mapping */
    int scount = 1024*1024;
    char * sbuf = calloc(scount, sizeof(char));
    strncat(sbuf, "<entries>\n", scount-strlen(sbuf)-1);
    ELLNODE * node;
    for(node = ellFirst(&cfg->devices); node; node = ellNext(node))
    {
        EC_DEVICE * device = (EC_DEVICE *)node;
        ELLNODE * node1;
        for(node1 = ellFirst(&device->pdo_entry_mappings); node1; node1 = ellNext(node1))
        {
            EC_PDO_ENTRY_MAPPING * mp = (EC_PDO_ENTRY_MAPPING *)node1;
            assert( mp->pdo_entry );
            char line[1024];
            assert(device->position != -1);
            snprintf(line, sizeof(line), "<entry device_position=\"%d\" "
                      "pdo_index=\"0x%x\" index=\"0x%x\" sub_index=\"0x%x\" "
                      "offset=\"%d\" bit=\"%d\" />\n", 
                     device->position, mp->pdo_entry->parent->index, 
                     mp->index, mp->sub_index, mp->offset, 
                     mp->bit_position);
            strncat(sbuf, line, scount-strlen(sbuf)-1);
        }
    }
    strncat(sbuf, "</entries>\n", scount-strlen(sbuf)-1);
    return sbuf;
}
开发者ID:ronaldomercado,项目名称:ethercat,代码行数:29,代码来源:parser.c

示例4: dbstat

/* print list of stopped records, and breakpoints set in locksets */
long epicsShareAPI dbstat(void)
{
  struct LS_LIST *pnode;
  struct BP_LIST *pbl;
  struct EP_LIST *pqe;
  epicsTimeStamp time;

  epicsMutexMustLock(bkpt_stack_sem);

  epicsTimeGetCurrent(&time);

 /*
  *  Traverse list, reporting stopped records
  */
  pnode = (struct LS_LIST *) ellFirst(&lset_stack);
  while (pnode != NULL) {
    if (pnode->precord != NULL) {

       printf("LSet: %lu  Stopped at: %-28.28s  #B: %5.5d  T: %p\n",
             pnode->l_num, pnode->precord->name, ellCount(&pnode->bp_list), pnode->taskid);

      /* for each entrypoint detected, print out entrypoint statistics */
       pqe = (struct EP_LIST *) ellFirst(&pnode->ep_queue); 
       while (pqe != NULL) {
          double diff = epicsTimeDiffInSeconds(&time,&pqe->time);
          if (diff) {
             printf("             Entrypoint: %-28.28s  #C: %5.5lu  C/S: %7.1f\n",
                 pqe->entrypoint->name, pqe->count,diff);
          }
          pqe = (struct EP_LIST *) ellNext((ELLNODE *)pqe);
       }
    }
    else {
       printf("LSet: %lu                                            #B: %5.5d  T: %p\n",
         pnode->l_num, ellCount(&pnode->bp_list), pnode->taskid);
    }

   /*
    *  Print out breakpoints set in the lock set
    */
    pbl = (struct BP_LIST *) ellFirst(&pnode->bp_list);
    while (pbl != NULL) {
        printf("             Breakpoint: %-28.28s", pbl->precord->name);

       /* display auto print flag */
        if (pbl->precord->bkpt & BKPT_PRINT_MASK)
           printf(" (ap)\n");
        else
           printf("\n");

        pbl = (struct BP_LIST *) ellNext((ELLNODE *)pbl);
    }

    pnode = (struct LS_LIST *) ellNext((ELLNODE *)pnode);
  }

  epicsMutexUnlock(bkpt_stack_sem);
  return(0);
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:60,代码来源:dbBkpt.c

示例5: dbNotifyDump

int epicsShareAPI dbNotifyDump(void)
{
    epicsMutexLockStatus lockStatus;
    dbRecordType *pdbRecordType;
    dbRecordNode *pdbRecordNode;
    dbCommon     *precord;
    putNotify    *ppn;
    putNotify    *ppnRestart;
    putNotifyRecord *ppnrWait;
    int itry;
   
    
    for(itry=0; itry<100; itry++) {
        lockStatus = epicsMutexTryLock(pnotifyGlobal->lock);
        if(lockStatus==epicsMutexLockOK) break;
        epicsThreadSleep(.05);
    }
    for(pdbRecordType = (dbRecordType *)ellFirst(&pdbbase->recordTypeList);
    pdbRecordType;
    pdbRecordType = (dbRecordType *)ellNext(&pdbRecordType->node)) {
        for (pdbRecordNode=(dbRecordNode *)ellFirst(&pdbRecordType->recList);
        pdbRecordNode;
        pdbRecordNode = (dbRecordNode *)ellNext(&pdbRecordNode->node)) {
            putNotifyPvt *pputNotifyPvt;
            precord = pdbRecordNode->precord;
            if (!precord->name[0] ||
                pdbRecordNode->flags & DBRN_FLAGS_ISALIAS)
                continue;
            if(!precord->ppn) continue;
            if(!precord->ppnr) continue;
            if(precord->ppn->paddr->precord != precord) continue;
            ppn = precord->ppn;
            pputNotifyPvt = (putNotifyPvt *)ppn->pputNotifyPvt;
            printf("%s state %d ppn %p\n  waitList\n",
                precord->name,pputNotifyPvt->state,(void*)ppn);
            ppnrWait = (putNotifyRecord *)ellFirst(&pputNotifyPvt->waitList);
            while(ppnrWait) {
                printf("    %s pact %d\n",
                    ppnrWait->precord->name,ppnrWait->precord->pact);
                ppnrWait = (putNotifyRecord *)ellNext(&ppnrWait->waitNode.node);
            }
            printf("  restartList\n");
            ppnRestart = (putNotify *)ellFirst(&precord->ppnr->restartList);
            while(ppnRestart) {
                printf("    %p\n", (void *)ppnRestart);
                ppnRestart = (putNotify *)ellNext(&ppnRestart->restartNode.node);
            }
        }
    }
    if(lockStatus==epicsMutexLockOK) epicsMutexUnlock(pnotifyGlobal->lock);
    return(0);
}
开发者ID:ukaea,项目名称:epics,代码行数:52,代码来源:dbNotify.c

示例6: signalStatusUpdate

void signalStatusUpdate(Port *pport)
{
 if( interruptAccept) 
    {
      ELLLIST *pclientList;
      interruptNode *pnode;

      asynInt32Interrupt *pInt32;
      epicsInt32 int32Value;

      pasynManager->interruptStart
        (pport->asynStdInterfaces.int32InterruptPvt, &pclientList);
      pnode = (interruptNode *)ellFirst(pclientList);
      while(pnode != NULL) 
        {
          pInt32 = (asynInt32Interrupt *) pnode->drvPvt;

          if( pInt32->pasynUser->reason == 2)
            {
              int32Value = pport->error;
              pInt32->callback(pInt32->userPvt, pInt32->pasynUser,
                               int32Value);
              break;
            }
          
          pnode = (interruptNode *)ellNext(&pnode->node);
        }

      pasynManager->interruptEnd(pport->asynStdInterfaces.int32InterruptPvt);
    }
}
开发者ID:epics-modules,项目名称:delaygen,代码行数:31,代码来源:drvAsynDG645.cpp

示例7: taskwdInsert

void taskwdInsert(epicsThreadId tid, TASKWDFUNC callback, void *usr)
{
    struct tNode *pt;
    struct mNode *pm;

    taskwdInit();
    if (tid == 0)
       tid = epicsThreadGetIdSelf();

    pt = &allocNode()->t;
    pt->tid = tid;
    pt->callback = callback;
    pt->usr = usr;
    pt->suspended = FALSE;

    epicsMutexMustLock(mLock);
    pm = (struct mNode *)ellFirst(&mList);
    while (pm) {
        if (pm->funcs->insert) {
            pm->funcs->insert(pm->usr, tid);
        }
        pm = (struct mNode *)ellNext(&pm->node);
    }
    epicsMutexUnlock(mLock);

    epicsMutexMustLock(tLock);
    ellAdd(&tList, (void *)pt);
    epicsMutexUnlock(tLock);
}
开发者ID:ukaea,项目名称:epics,代码行数:29,代码来源:taskwd.c

示例8: devAdmin_AO_T1

static void devAdmin_AO_T1(ST_execParam *pParam)
{
	ST_ADMIN *pAdminCfg = drvAdmin_get_AdminPtr();
	struct dbCommon *precord = pParam->precord;
	ST_STD_device *pSTDdev = (ST_STD_device*) ellFirst(pAdminCfg->pList_DeviceTask);

	if( pAdminCfg->StatusAdmin & TASK_ARM_ENABLED ) 
	{
		epicsPrintf("ERROR!   System armed! please check again. (0x%x)\n", pAdminCfg->StatusAdmin);
		return;
	}
	if( pParam->n32Arg0 >= SIZE_CNT_MULTI_TRIG ) {
		epicsPrintf("ERROR!   Timing section not valid(%d).\n", pParam->n32Arg0);
		return;
	}
	pAdminCfg->ST_Base.dT1[pParam->n32Arg0]= (double)pParam->setValue;
	
	while(pSTDdev) {

  		pSTDdev = (ST_STD_device*) ellNext(&pSTDdev->node);
	}
	
	epicsPrintf("T1 (%lf): Sec. %d, %s %s (%s)\n", pAdminCfg->ST_Base.dT1[pParam->n32Arg0], pParam->n32Arg0, 
		pAdminCfg->taskName, precord->name, epicsThreadGetNameSelf());
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:25,代码来源:sfwAdminBody.c

示例9: epicsThreadPoolReport

void epicsThreadPoolReport(epicsThreadPool *pool, FILE *fd)
{
    ELLNODE *cur;
    epicsMutexMustLock(pool->guard);

    fprintf(fd, "Thread Pool with %u/%u threads\n"
            " running %d jobs with %u threads\n",
            pool->threadsRunning,
            pool->conf.maxThreads,
            ellCount(&pool->jobs),
            pool->threadsAreAwake);
    if (pool->pauseadd)
        fprintf(fd, "  Inhibit queueing\n");
    if (pool->pauserun)
        fprintf(fd, "  Pause workers\n");
    if (pool->shutdown)
        fprintf(fd, "  Shutdown in progress\n");

    for (cur = ellFirst(&pool->jobs); cur; cur = ellNext(cur)) {
        epicsJob *job = CONTAINER(cur, epicsJob, jobnode);

        fprintf(fd, "  job %p func: %p, arg: %p ",
                job, job->func,
                job->arg);
        if (job->queued)
            fprintf(fd, "Queued ");
        if (job->running)
            fprintf(fd, "Running ");
        if (job->freewhendone)
            fprintf(fd, "Free ");
        fprintf(fd, "\n");
    }

    epicsMutexUnlock(pool->guard);
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:35,代码来源:threadPool.c

示例10: drvMK80S_scanTask

static void drvMK80S_scanTask(int param)
{
	kuDebug (kuTRACE, "[drvMK80S_scanTask] ... \n");

    drvMK80SConfig* pdrvMK80SConfig = NULL;
    double drvMK80S_scanInterval;

    while(!pdrvMK80S_ellList || ellCount(pdrvMK80S_ellList) <1) {
        epicsThreadSleep(1.);
    }

    while(1) {
        pdrvMK80SConfig = (drvMK80SConfig*) ellFirst(pdrvMK80S_ellList);
        drvMK80S_scanInterval = pdrvMK80SConfig->scanInterval;

        do {
            if(drvMK80S_scanInterval > pdrvMK80SConfig->scanInterval) {
                drvMK80S_scanInterval = pdrvMK80SConfig->scanInterval;
			}

            if(!pdrvMK80SConfig->cbCount) {
                pdrvMK80SConfig->cbCount++;

				kuDebug (kuDEBUG, "[drvMK80S_scanTask] pasynManager->queueRequest() \n");
                pasynManager->queueRequest(pdrvMK80SConfig->pasynMK80SUser, asynQueuePriorityLow, pdrvMK80SConfig->cbTimeout);
            }

            pdrvMK80SConfig = (drvMK80SConfig*) ellNext(&pdrvMK80SConfig->node);
        } while(pdrvMK80SConfig);

        epicsThreadSleep(drvMK80S_scanInterval);
    }

	kuDebug (kuCRI, "[drvMK80S_scanTask] end ...\n");
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:35,代码来源:drvMK80S.c

示例11: devNI6123_AO_DAQ_SAMPLEING_RATE

static void devNI6123_AO_DAQ_SAMPLEING_RATE(ST_execParam *pParam)
{
        ST_MASTER *pMaster = get_master();
        ST_STD_device *pSTDdev = (ST_STD_device*) ellFirst(pMaster->pList_DeviceTask);
        ST_NI6123 *pNI6123 = NULL;

        kLog (K_DATA,"[devNI6123_AO_DAQ_SAMPLEING_RATE] sampleRate(%f)\n", pParam->setValue);

        while(pSTDdev) {
                if (pSTDdev->StatusDev & TASK_ARM_ENABLED) {
                        kLog (K_DATA,"[devNI6123_AO_DAQ_SAMPLEING_RATE] %s: System is armed! \n", pSTDdev->taskName);
                        notify_error (1, "System is armed!", pSTDdev->taskName );
                }
                else {
                        pNI6123 = pSTDdev->pUser;
			if(pParam->setValue > pNI6123->sample_rateLimit){
				/*  Device Sampling Rate Limit Cut if User is over Sampling Rate Setting.  */
				pParam->setValue = pNI6123->sample_rateLimit;
			} else if(pParam->setValue <= 0){
				 pParam->setValue = 1;
			}
			pNI6123->sample_rate = pParam->setValue;
                        scanIoRequest(pSTDdev->ioScanPvt_userCall);

                        kLog (K_DATA,"[devNI6123_AO_DAQ_SAMPLEING_RATE] task(%s) sampleRate(%.f)\n",
                                        pSTDdev->taskName, pNI6123->sample_rate);
                }

                pSTDdev = (ST_STD_device*) ellNext(&pSTDdev->node);
        }
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:31,代码来源:devNI6123.c

示例12: epicsThreadShow

epicsShareFunc void epicsShareAPI epicsThreadShow(epicsThreadId showThread, unsigned int level)
{
    epicsThreadOSD *pthreadInfo;
    int status;
    int found = 0;

    epicsThreadInit();
    if(!showThread) {
        showThreadInfo(0,level);
        return;
    }
    status = mutexLock(&listLock);
    checkStatusQuit(status,"pthread_mutex_lock","epicsThreadShowAll");
    pthreadInfo=(epicsThreadOSD *)ellFirst(&pthreadList);
    while(pthreadInfo) {
        if (((epicsThreadId)pthreadInfo == showThread)
         || ((epicsThreadId)pthreadInfo->tid == showThread)) {
            found = 1;
            showThreadInfo(pthreadInfo,level);
        }
        pthreadInfo=(epicsThreadOSD *)ellNext(&pthreadInfo->node);
    }
    status = pthread_mutex_unlock(&listLock);
    checkStatusQuit(status,"pthread_mutex_unlock","epicsThreadShowAll");
    if (!found)
        printf("Thread %#lx (%lu) not found.\n", (unsigned long)showThread, (unsigned long)showThread);
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:27,代码来源:osdThread.c

示例13: devNI6123_AO_DAQ_MAX_VOLT

static void devNI6123_AO_DAQ_MAX_VOLT(ST_execParam *pParam)
{
        ST_MASTER *pMaster = get_master();
        ST_STD_device *pSTDdev = (ST_STD_device*) ellFirst(pMaster->pList_DeviceTask);
        ST_NI6123 *pNI6123 = NULL;

        kLog (K_DATA,"[devNI6123_AO_DAQ_MAX_VOLT] minVolt(%f)\n", pParam->setValue);

        while(pSTDdev) {
                if (pSTDdev->StatusDev & TASK_ARM_ENABLED) {
                        kLog (K_DATA,"[devNI6123_AO_DAQ_MAX_VOLT] %s: System is armed! \n", pSTDdev->taskName);
                        notify_error (1, "System is armed!", pSTDdev->taskName );
                }
                else {
                        pNI6123 = pSTDdev->pUser;
                        pNI6123->maxVal = pParam->setValue;
                        scanIoRequest(pSTDdev->ioScanPvt_userCall);

                        kLog (K_DATA,"[devNI6123_AO_DAQ_MAX_VOLT] task(%s) maxVolt(%.f)\n",
                                        pSTDdev->taskName, pNI6123->maxVal);
                }

                pSTDdev = (ST_STD_device*) ellNext(&pSTDdev->node);
        }
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:25,代码来源:devNI6123.c

示例14: devNI6123_BO_AUTO_RUN

/* auto Run function */
static void devNI6123_BO_AUTO_RUN(ST_execParam *pParam)
{
        ST_MASTER *pMaster = get_master();
        ST_STD_device *pSTDdev = (ST_STD_device*) ellFirst(pMaster->pList_DeviceTask);
        ST_NI6123 *pNI6123 = NULL;

        kLog (K_TRACE, "[devNI6123_BO_AUTO_RUN] auto_run(%f)\n", pParam->setValue);

        if( pMaster->StatusAdmin & TASK_WAIT_FOR_TRIGGER ||
                        pMaster->StatusAdmin & TASK_IN_PROGRESS ) {
                kLog (K_ERR, "System is running! (0x%x)\n", pMaster->StatusAdmin);
                notify_error (1, "System is running! (0x%x)\n", pMaster->StatusAdmin);
                return;
        }

        if(pParam->setValue) {
                if( !(pMaster->StatusAdmin & TASK_SYSTEM_IDLE) ) {
                        kLog (K_ERR, "System is busy! (0x%x)\n", pMaster->StatusAdmin);
                        notify_error (1, "System is busy! (0x%x)\n", pMaster->StatusAdmin);
                        return;
                }
#if 0
		char strBuf[24];
		float stopT1;
	/*	remove this function because ECH has not LTU, so We donot use the DBproc_get function */
				if( pSTDdev->ST_Base.opMode == OPMODE_REMOTE ){
					DBproc_get (PV_LTU_TIG_T0_STR, strBuf);   //Get T0 from LTU
					DBproc_put (PV_START_TIG_T0_STR, strBuf);   //Set T0 from LTU
					sscanf(strBuf, "%f", &stopT1);
					stopT1 = pNI6123->sample_time - stopT1;
					sprintf(strBuf,"%f",stopT1);
					DBproc_put (PV_STOP_TIG_T1_STR, strBuf);   //Set T0 from LTU
				}
#endif
                while(pSTDdev) {
                        pSTDdev->StatusDev |= TASK_STANDBY;

                        pNI6123 = pSTDdev->pUser;
                        pNI6123->auto_run_flag = 1;

                        pSTDdev = (ST_STD_device*) ellNext(&pSTDdev->node);
                }
        }
        else if(!pParam->setValue) {
                while(pSTDdev) {
                        pNI6123 = pSTDdev->pUser;
                        pNI6123->auto_run_flag = 0;

                        pSTDdev = (ST_STD_device*) ellNext(&pSTDdev->node);
                }

                pMaster->n8EscapeWhile = 0;
                epicsThreadSleep(3.0);
                pMaster->n8EscapeWhile = 1;
                admin_all_taskStatus_reset();
                scanIoRequest(pMaster->ioScanPvt_status);
        }

        notify_refresh_master_status();
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:61,代码来源:devNI6123.c

示例15: gphFreeMem

void epicsShareAPI gphFreeMem(gphPvt *pgphPvt)
{
    ELLLIST **paplist;
    int h;

    /* Caller must ensure that no other thread is using *pvt */
    if (pgphPvt == NULL) return;

    paplist = pgphPvt->paplist;
    for (h = 0; h < pgphPvt->size; h++) {
        ELLLIST *plist = paplist[h];
        GPHENTRY *pgphNode;
        GPHENTRY *next;

        if (plist == NULL) continue;
        pgphNode = (GPHENTRY *) ellFirst(plist);

        while (pgphNode) {
            next = (GPHENTRY *) ellNext((ELLNODE*)pgphNode);
            ellDelete(plist, (ELLNODE*)pgphNode);
            free(pgphNode);
            pgphNode = next;
        }
        free(paplist[h]);
    }
    epicsMutexDestroy(pgphPvt->lock);
    free(paplist);
    free(pgphPvt);
}
开发者ID:zlxmsu,项目名称:epics,代码行数:29,代码来源:gpHashLib.c


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