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


C++ StructureConstPtr::getFieldIndex方法代码示例

本文整理汇总了C++中StructureConstPtr::getFieldIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ StructureConstPtr::getFieldIndex方法的具体用法?C++ StructureConstPtr::getFieldIndex怎么用?C++ StructureConstPtr::getFieldIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StructureConstPtr的用法示例。


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

示例1: initialize

void RecordProcess::initialize()
{
    pvRecord.lock();
    try {
        if(trace) traceMessage(" initialize");
        PVRecordStructure &pvRecordStructure = pvRecord.getPVRecordStructure();
        PVStructure &pvStructure = pvRecordStructure.getPVStructure();
        fieldSupport = const_cast<Support *>(pvRecordStructure.getSupport());
        if(fieldSupport==0) {
            throw std::logic_error(pvRecord.getRecordName() + " has no support");
        }
        PVFieldPtrArray pvFields = pvStructure.getPVFields();
        PVRecordFieldPtrArray pvRecordFields =
            pvRecordStructure.getPVRecordFields();
        StructureConstPtr structure = pvStructure.getStructure();
        int index;
        index = structure->getFieldIndex("timeStamp");
        if(index>=0) {
            pvTimeStamp.attach(pvFields[index]);
        }
        index = structure->getFieldIndex("scan");
        if(index>=0) {
            scanSupport = pvRecordFields[index]->getSupport();
            scanField = ScanField::create(pvRecord);
            if(scanField.get()!=0) {
            	pvSingleProcessRequester = 
                     &scanField->getSingleProcessRequesterPV();
            	pvRecordFieldSingleProcessRequester =
                     &pvRecord.findPVRecordField(*pvSingleProcessRequester);
                pvProcessAfterStart = &scanField->getProcessAfterStartPV();
            }
        }
        fieldSupport->initialize();
        pvRecord.unlock();
    } catch(...) {
        pvRecord.unlock();
        throw;
    }
}
开发者ID:epics-base,项目名称:pvIOCCPP,代码行数:39,代码来源:recordProcess.cpp

示例2: fixParentStructure

void PVStructure::fixParentStructure()
{
    PVStructure *parent = getParent();
    if(parent==NULL) return;
    StructureConstPtr parentStructure = parent->structurePtr;
    String fieldName = getFieldName();
    size_t index = parentStructure->getFieldIndex(fieldName);
    StringArray const &fieldNames = parentStructure->getFieldNames();
    size_t num = fieldNames.size();
    FieldConstPtrArray fields(num);
    FieldConstPtrArray const & oldFields = parentStructure->getFields();
    for(size_t i=0; i< num; i++) {
        if(i==index) {
            fields[i] = structurePtr;
        } else {
            fields[i] = oldFields[i];
        }
    }
    FieldConstPtr field = getFieldCreate()->createStructure(
        parentStructure->getID(),fieldNames,fields);
    parent->replaceField(field);
    parent->fixParentStructure();
}
开发者ID:,项目名称:,代码行数:23,代码来源:


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