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


C++ StandardFieldPtr::enumerated方法代码示例

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


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

示例1: init

void DbPv::init()
{
    // this requires valid existance of dbPv::shared_pointer instance
    StandardFieldPtr standardField = getStandardField();
    ScalarType scalarType = pvBoolean;
    switch(dbChannelFinalFieldType(dbChan)) {
        case DBF_CHAR:
            scalarType = pvByte; break;
        case DBF_UCHAR:
            scalarType = pvUByte; break;
        case DBF_SHORT:
            scalarType = pvShort; break;
        case DBF_USHORT:
            scalarType = pvUShort; break;
        case DBF_LONG:
            scalarType = pvInt; break;
        case DBF_ULONG:
            scalarType = pvUInt; break;
        case DBF_FLOAT:
            scalarType = pvFloat; break;
        case DBF_DOUBLE:
            scalarType = pvDouble; break;
        case DBF_STRING:
            scalarType = pvString; break;

        case DBF_ENUM:
        case DBF_MENU:
        case DBF_DEVICE:
            recordField = standardField->enumerated("value,timeStamp,alarm");
            return;
        case DBF_INLINK:
        case DBF_OUTLINK:
        case DBF_FWDLINK:
            scalarType = pvString; break;
        default:
          break;
    }
    bool isArray = (dbChannelFinalElements(dbChan) > 1) ? true : false;
    if(scalarType==pvString) {  
        if(isArray) {
            recordField = standardField->scalarArray(scalarType,
                "value,timeStamp,alarm");
        } else {
            recordField = standardField->scalar(scalarType,
                "value,timeStamp,alarm");
        }
    }
    else if(scalarType!=pvBoolean) {
        if(isArray) {
            recordField = standardField->scalarArray(scalarType,
                "value,timeStamp,alarm,display");
        } else {
            recordField = standardField->scalar(scalarType,
                "value,timeStamp,alarm,display,control,valueAlarm");
        }
    }
}
开发者ID:dhickin,项目名称:pvaSrv,代码行数:57,代码来源:dbPv.cpp

示例2: createStructure

static Structure::const_shared_pointer createStructure(CAChannel::shared_pointer const & channel, string const & properties)
{
    StandardFieldPtr standardField = getStandardField();
    Structure::const_shared_pointer structure;

    chtype channelType = channel->getNativeType();
    if (channelType != DBR_ENUM)
    {
        ScalarType st = dbr2ST[channelType];
        structure = (channel->getElementCount() > 1) ?
                     standardField->scalarArray(st, properties) :
                     standardField->scalar(st, properties);
    }
    else
    {
        // NOTE: enum arrays not supported
        structure = standardField->enumerated(properties);
    }

    return structure;
}
开发者ID:ralphlange,项目名称:pvAccessCPP,代码行数:21,代码来源:caChannel.cpp


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