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

C++ ellFirst函数代码示例

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

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



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


示例16: notifyInit

static void notifyInit(processNotify *ppn)
{
    notifyPvt *pnotifyPvt;

    pnotifyPvt = (notifyPvt *) ellFirst(&pnotifyGlobal->freeList);
    if (pnotifyPvt) {
        ellDelete(&pnotifyGlobal->freeList, &pnotifyPvt->node);
    } else {
        pnotifyPvt = dbCalloc(1,sizeof(notifyPvt));
        pnotifyPvt->cancelEvent = epicsEventCreate(epicsEventEmpty);
        pnotifyPvt->userCallbackEvent = epicsEventCreate(epicsEventEmpty);
        pnotifyPvt->magic = MAGIC;
        pnotifyPvt->state = notifyNotActive;
    }
    pnotifyPvt->state = notifyNotActive;
    callbackSetCallback(notifyCallback,&pnotifyPvt->callback);
    callbackSetUser(ppn,&pnotifyPvt->callback);
    callbackSetPriority(priorityLow,&pnotifyPvt->callback);
    ellInit(&pnotifyPvt->waitList);
    ppn->status = notifyOK;
    ppn->wasProcessed = 0;
    pnotifyPvt->state = notifyNotActive;
    pnotifyPvt->cancelWait = pnotifyPvt->userCallbackWait = 0;
    ppn->pnotifyPvt = pnotifyPvt;
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:25,代码来源:dbNotify.c


示例17: fill_cache

static
int fill_cache(epicsUInt16 dev,epicsUInt16 vend)
{
  ELLNODE *cur;
  const dev_vend_entry *current;
  dev_vend_entry *next;

  for(cur=ellFirst(&dev_vend_cache); cur; cur=ellNext(cur)){
    current=CONTAINER(cur,const dev_vend_entry,node);

    /* If one device is found then all must be in cache */
    if( current->device==dev && current->vendor==vend )
      return 0;
  }

  next=malloc(sizeof(dev_vend_entry));
  if(!next)
    return S_dev_noMemory;
  next->device=dev;
  next->vendor=vend;

  if( sharedDevPCIFind(dev,vend,&devices) ){
    free(next);
    return S_dev_addressNotFound;
  }

  /* Prepend */
  ellInsert(&dev_vend_cache, NULL, &next->node);

  return 0;
}
开发者ID:Sangil-Lee,项目名称:Work,代码行数:31,代码来源:osdPciShared.c


示例18: float64Write

static asynStatus float64Write(void *pvt,asynUser *pasynUser,
                               epicsFloat64 value)
{
    drvPvt   *pdrvPvt = (drvPvt *)pvt;
    int        addr;
    asynStatus status;
    ELLLIST *pclientList;
    interruptNode *pnode;
    asynFloat64Interrupt *pinterrupt;

    status = getAddr(pdrvPvt,pasynUser,&addr,0);
    if(status!=asynSuccess) return status;
    epicsMutexMustLock(pdrvPvt->lock);
    pdrvPvt->interruptDelay = value;
    epicsMutexUnlock(pdrvPvt->lock);
    epicsEventSignal(pdrvPvt->waitWork);
    asynPrint(pasynUser,ASYN_TRACEIO_DRIVER,
              "%s addr %d write %f\n",pdrvPvt->portName,addr,value);
    pasynManager->interruptStart(pdrvPvt->asynFloat64Pvt, &pclientList);
    pnode = (interruptNode *)ellFirst(pclientList);
    while (pnode) {
        pinterrupt = pnode->drvPvt;
        if(addr==pinterrupt->addr && pinterrupt->pasynUser->reason==1) {
            pinterrupt->callback(pinterrupt->userPvt,pinterrupt->pasynUser,value);
            break;
        }
        pnode = (interruptNode *)ellNext(&pnode->node);
    }
    pasynManager->interruptEnd(pdrvPvt->asynFloat64Pvt);
    return asynSuccess;
}
开发者ID:ukaea,项目名称:epics,代码行数:31,代码来源:uint32DigitalDriver.c


示例19: taskwdAnyRemove

void taskwdAnyRemove(void *key)
{
    struct mNode *pm;
    struct aNode *pa;

    taskwdInit();

    epicsMutexMustLock(mLock);
    pm = (struct mNode *)ellFirst(&mList);
    while (pm) {
        if (pm->funcs == &anyFuncs) {
            pa = (struct aNode *)pm->usr;
            if (pa->key == key) {
                ellDelete(&mList, (void *)pm);
                freeNode((union twdNode *)pa);
                freeNode((union twdNode *)pm);
                epicsMutexUnlock(mLock);
                return;
            }
        }
        pm = (struct mNode *)ellNext(&pm->node);
    }
    epicsMutexUnlock(mLock);

    errlogPrintf("taskwdAnyRemove: Unregistered key %p\n", key);
}
开发者ID:ukaea,项目名称:epics,代码行数:26,代码来源:taskwd.c


示例20: devInsertAddress

/*
 *      devInsertAddress()
 */
static void devInsertAddress(
ELLLIST     *pRangeList,
rangeItem   *pNewRange)
{
    rangeItem   *pBefore;
    rangeItem   *pAfter;

    epicsMutexMustLock(addrListLock);
    pAfter = (rangeItem *) ellFirst (pRangeList);
    while (pAfter) {
        if (pNewRange->end < pAfter->begin) {
            break;
        }
        pAfter = (rangeItem *) ellNext (&pAfter->node);
    }

    if (pAfter) {
        pBefore = (rangeItem *) ellPrevious (&pAfter->node);
        ellInsert (pRangeList, &pBefore->node, &pNewRange->node);
    }
    else {
        ellAdd (pRangeList, &pNewRange->node);
    }
    epicsMutexUnlock(addrListLock);
}
开发者ID:ukaea,项目名称:epics,代码行数:28,代码来源:devLibVME.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ellNext函数代码示例发布时间:2022-05-30
下一篇:
C++ ellAdd函数代码示例发布时间: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