本文整理汇总了C++中StandardFieldPtr::scalarArray方法的典型用法代码示例。如果您正苦于以下问题:C++ StandardFieldPtr::scalarArray方法的具体用法?C++ StandardFieldPtr::scalarArray怎么用?C++ StandardFieldPtr::scalarArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StandardFieldPtr
的用法示例。
在下文中一共展示了StandardFieldPtr::scalarArray方法的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");
}
}
}
示例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;
}