本文整理汇总了C++中PVStructurePtr::getStringField方法的典型用法代码示例。如果您正苦于以下问题:C++ PVStructurePtr::getStringField方法的具体用法?C++ PVStructurePtr::getStringField怎么用?C++ PVStructurePtr::getStringField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVStructurePtr
的用法示例。
在下文中一共展示了PVStructurePtr::getStringField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool RecordListRecord::init()
{
initPVRecord();
PVStructurePtr pvStructure = getPVStructure();
database = pvStructure->getStringField("argument.database");
if(database.get()==NULL) return false;
regularExpression = pvStructure->getStringField(
"argument.regularExpression");
if(regularExpression.get()==NULL) return false;
status = pvStructure->getStringField("result.status");
if(status.get()==NULL) return false;
PVFieldPtr pvField = pvStructure->getSubField("result.names");
if(pvField.get()==NULL) {
std::cerr << "no result.names" << std::endl;
return false;
}
name = static_pointer_cast<PVStringArray>(
pvStructure->getScalarArrayField("result.names",pvString));
if(name.get()==NULL) return false;
return true;
}
示例2: attach
bool PVDisplay::attach(PVFieldPtr const & pvField)
{
if(pvField->getField()->getType()!=structure) {
pvField->message(noDisplayFound,errorMessage);
return false;
}
PVStructurePtr pvStructure = static_pointer_cast<PVStructure>(pvField);
pvDescription = pvStructure->getStringField("description");
if(pvDescription.get()==NULL) {
pvField->message(noDisplayFound,errorMessage);
return false;
}
pvFormat = pvStructure->getStringField("format");
if(pvFormat.get()==NULL) {
pvField->message(noDisplayFound,errorMessage);
detach();
return false;
}
pvUnits = pvStructure->getStringField("units");
if(pvUnits.get()==NULL) {
pvField->message(noDisplayFound,errorMessage);
detach();
return false;
}
pvLow = pvStructure->getDoubleField(String("limitLow"));
if(pvLow.get()==NULL) {
pvField->message(noDisplayFound,errorMessage);
detach();
return false;
}
pvHigh = pvStructure->getDoubleField(String("limitHigh"));
if(pvHigh.get()==NULL) {
pvField->message(noDisplayFound,errorMessage);
detach();
return false;
}
return true;
}
示例3: attach
bool PVAlarm::attach(PVFieldPtr const & pvField)
{
if(pvField->getField()->getType()!=structure) return false;
PVStructurePtr pvStructure = static_pointer_cast<PVStructure>(pvField);
pvSeverity = pvStructure->getIntField("severity");
if(pvSeverity.get()==NULL) return false;
pvStatus = pvStructure->getIntField("status");
if(pvStatus.get()==NULL) {
pvSeverity.reset();
return false;
}
pvMessage = pvStructure->getStringField("message");
if(pvMessage.get()==NULL) {
pvSeverity.reset();
pvStatus.reset();
return false;
}
return true;
}
示例4: createRequest
/**
* Creates an NTURI request.
*
* @param path the value of the NTURI path field
* @param fieldnames the names of fields in the NTURI query
* @return values the values of fields in the NTURI query
*/
PVStructurePtr createRequest(const std::string & path,
const std::vector<std::string> & fieldnames,
const std::vector<std::string> & values)
{
StructureConstPtr archiverStructure = makeRequestStructure(*getFieldCreate(), fieldnames);
PVStructurePtr request(getPVDataCreate()->createPVStructure(archiverStructure));
// set scheme.
request->getStringField("scheme")->put("pva");
// set path.
request->getStringField("path")->put(path);
// Set query.
PVStructurePtr query = request->getStructureField("query");
for (size_t i = 0; i < fieldnames.size(); ++i)
{
query->getStringField(fieldnames[i])->put(values[i]);
}
return request;
}