本文整理汇总了C++中PVRecordPtr::getPVRecordStructure方法的典型用法代码示例。如果您正苦于以下问题:C++ PVRecordPtr::getPVRecordStructure方法的具体用法?C++ PVRecordPtr::getPVRecordStructure怎么用?C++ PVRecordPtr::getPVRecordStructure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVRecordPtr
的用法示例。
在下文中一共展示了PVRecordPtr::getPVRecordStructure方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
ChannelPutGetLocalPtr ChannelPutGetLocal::create(
ChannelLocalPtr const &channelLocal,
ChannelPutGetRequester::shared_pointer const & channelPutGetRequester,
PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord)
{
PVCopyPtr pvPutCopy = PVCopy::create(
pvRecord->getPVRecordStructure()->getPVStructure(),
pvRequest,
"putField");
PVCopyPtr pvGetCopy = PVCopy::create(
pvRecord->getPVRecordStructure()->getPVStructure(),
pvRequest,
"getField");
if(!pvPutCopy || !pvGetCopy) {
Status status(
Status::STATUSTYPE_ERROR,
"invalid pvRequest");
ChannelPutGet::shared_pointer channelPutGet;
channelPutGetRequester->channelPutGetConnect(
status,
channelPutGet,
nullStructure,
nullStructure);
ChannelPutGetLocalPtr localPutGet;
return localPutGet;
}
PVStructurePtr pvGetStructure = pvGetCopy->createPVStructure();
BitSetPtr getBitSet(new BitSet(pvGetStructure->getNumberFields()));
ChannelPutGetLocalPtr putGet(new ChannelPutGetLocal(
getProcess(pvRequest,true),
channelLocal,
channelPutGetRequester,
pvPutCopy,
pvGetCopy,
pvGetStructure,
getBitSet,
pvRecord));
if(pvRecord->getTraceLevel()>0)
{
cout << "ChannelPutGetLocal::create";
cout << " recordName " << pvRecord->getRecordName() << endl;
}
channelPutGetRequester->channelPutGetConnect(
Status::Ok, putGet, pvPutCopy->getStructure(),pvGetCopy->getStructure());
return putGet;
}
示例2: arrayTest
static void arrayTest()
{
cout << endl << endl << "****arrayTest****" << endl;
RequesterPtr requester(new MyRequester("exampleTest"));
PVRecordPtr pvRecord;
string request;
PVStructurePtr pvRequest;
PVCopyPtr pvCopy;
string builder;
string valueNameRecord;
string valueNameCopy;
CreateRequest::shared_pointer createRequest = CreateRequest::create();
pvRecord = createScalarArray("doubleArrayRecord",pvDouble,"alarm,timeStamp");
valueNameRecord = request = "value";
pvRequest = createRequest->createRequest(request);
cout << "request " << request << endl << "pvRequest" << *pvRequest << endl ;
pvCopy = PVCopy::create(pvRecord->getPVRecordStructure()->getPVStructure(),pvRequest,"");
valueNameCopy = "value";
testPVScalarArray(pvDouble,valueNameRecord,valueNameCopy,pvRecord,pvCopy);
request = "";
valueNameRecord = "value";
pvRequest = createRequest->createRequest(request);
cout << "request " << request << endl << "pvRequest" << *pvRequest << endl ;
pvCopy = PVCopy::create(pvRecord->getPVRecordStructure()->getPVStructure(),pvRequest,"");
valueNameCopy = "value";
testPVScalarArray(pvDouble,valueNameRecord,valueNameCopy,pvRecord,pvCopy);
request = "alarm,timeStamp,value";
valueNameRecord = "value";
pvRequest = createRequest->createRequest(request);
cout << "request " << request << endl << "pvRequest" << *pvRequest << endl ;
pvCopy = PVCopy::create(pvRecord->getPVRecordStructure()->getPVStructure(),pvRequest,"");
valueNameCopy = "value";
testPVScalarArray(pvDouble,valueNameRecord,valueNameCopy,pvRecord,pvCopy);
pvRecord->destroy();
}
示例3: testPVScalar
static void testPVScalar(
string const & valueNameRecord,
string const & valueNameCopy,
PVRecordPtr const & pvRecord,
PVCopyPtr const & pvCopy)
{
PVStructurePtr pvStructureRecord;
PVStructurePtr pvStructureCopy;
PVFieldPtr pvField;
PVScalarPtr pvValueRecord;
PVScalarPtr pvValueCopy;
BitSetPtr bitSet;
size_t offset;
ConvertPtr convert = getConvert();
cout << endl;
pvStructureRecord = pvRecord->getPVRecordStructure()->getPVStructure();
pvField = pvStructureRecord->getSubField(valueNameRecord);
pvValueRecord = static_pointer_cast<PVScalar>(pvField);
convert->fromDouble(pvValueRecord,.04);
StructureConstPtr structure = pvCopy->getStructure();
cout << "structure from copy" << endl << *structure << endl;
pvStructureCopy = pvCopy->createPVStructure();
pvField = pvStructureCopy->getSubField(valueNameCopy);
pvValueCopy = static_pointer_cast<PVScalar>(pvField);
bitSet = BitSetPtr(new BitSet(pvStructureCopy->getNumberFields()));
pvCopy->initCopy(pvStructureCopy, bitSet);
cout << "after initCopy pvValueCopy " << convert->toDouble(pvValueCopy);
cout << endl;
convert->fromDouble(pvValueRecord,.06);
pvCopy->updateCopySetBitSet(pvStructureCopy,bitSet);
cout << "after put(.06) pvValueCopy " << convert->toDouble(pvValueCopy);
cout << " bitSet " << *bitSet;
cout << endl;
offset = pvCopy->getCopyOffset(pvValueRecord);
cout << "getCopyOffset() " << offset;
cout << " pvValueCopy->getOffset() " << pvValueCopy->getFieldOffset();
cout << " pvValueRecord->getOffset() " << pvValueRecord->getFieldOffset();
cout << " bitSet " << *bitSet;
cout << endl;
bitSet->clear();
convert->fromDouble(pvValueRecord,1.0);
cout << "before updateCopyFromBitSet";
cout << " recordValue " << convert->toDouble(pvValueRecord);
cout << " copyValue " << convert->toDouble(pvValueCopy);
cout << " bitSet " << *bitSet;
cout << endl;
bitSet->set(0);
pvCopy->updateCopyFromBitSet(pvStructureCopy,bitSet);
cout << "after updateCopyFromBitSet";
cout << " recordValue " << convert->toDouble(pvValueRecord);
cout << " copyValue " << convert->toDouble(pvValueCopy);
cout << " bitSet " << *bitSet;
cout << endl;
convert->fromDouble(pvValueCopy,2.0);
bitSet->set(0);
cout << "before updateMaster";
cout << " recordValue " << convert->toDouble(pvValueRecord);
cout << " copyValue " << convert->toDouble(pvValueCopy);
cout << " bitSet " << *bitSet;
cout << endl;
pvCopy->updateMaster(pvStructureCopy,bitSet);
cout << "after updateMaster";
cout << " recordValue " << convert->toDouble(pvValueRecord);
cout << " copyValue " << convert->toDouble(pvValueCopy);
cout << " bitSet " << *bitSet;
cout << endl;
}
示例4: testPVScalarArray
static void testPVScalarArray(
ScalarType scalarType,
string const & valueNameRecord,
string const & valueNameCopy,
PVRecordPtr const & pvRecord,
PVCopyPtr const & pvCopy)
{
PVStructurePtr pvStructureRecord;
PVStructurePtr pvStructureCopy;
PVScalarArrayPtr pvValueRecord;
PVScalarArrayPtr pvValueCopy;
BitSetPtr bitSet;
size_t offset;
size_t n = 5;
shared_vector<double> values(n);
cout << endl;
pvStructureRecord = pvRecord->getPVRecordStructure()->getPVStructure();
pvValueRecord = pvStructureRecord->getScalarArrayField(valueNameRecord,scalarType);
for(size_t i=0; i<n; i++) values[i] = i;
const shared_vector<const double> xxx(freeze(values));
pvValueRecord->putFrom(xxx);
StructureConstPtr structure = pvCopy->getStructure();
cout << "structure from copy" << endl << *structure << endl;
pvStructureCopy = pvCopy->createPVStructure();
pvValueCopy = pvStructureCopy->getScalarArrayField(valueNameCopy,scalarType);
bitSet = BitSetPtr(new BitSet(pvStructureCopy->getNumberFields()));
pvCopy->initCopy(pvStructureCopy, bitSet);
cout << "after initCopy pvValueCopy " << *pvValueCopy << endl;
cout << endl;
values.resize(n);
for(size_t i=0; i<n; i++) values[i] = i + .06;
const shared_vector<const double> yyy(freeze(values));
pvValueRecord->putFrom(yyy);
pvCopy->updateCopySetBitSet(pvStructureCopy,bitSet);
cout << "after put(i+ .06) pvValueCopy " << *pvValueCopy << endl;
cout << " bitSet " << *bitSet;
cout << endl;
offset = pvCopy->getCopyOffset(pvValueRecord);
cout << "getCopyOffset() " << offset;
cout << " pvValueCopy->getOffset() " << pvValueCopy->getFieldOffset();
cout << " pvValueRecord->getOffset() " << pvValueRecord->getFieldOffset();
cout << " bitSet " << *bitSet;
cout << endl;
bitSet->clear();
values.resize(n);
for(size_t i=0; i<n; i++) values[i] = i + 1.0;
const shared_vector<const double> zzz(freeze(values));
pvValueRecord->putFrom(zzz);
cout << "before updateCopyFromBitSet";
cout << " recordValue " << *pvValueRecord << endl;
cout << " copyValue " << *pvValueCopy << endl;
cout << " bitSet " << *bitSet;
cout << endl;
bitSet->set(0);
pvCopy->updateCopyFromBitSet(pvStructureCopy,bitSet);
cout << "after updateCopyFromBitSet";
cout << " recordValue " << *pvValueRecord << endl;
cout << " copyValue " << *pvValueCopy << endl;
cout << " bitSet " << *bitSet;
cout << endl;
values.resize(n);
for(size_t i=0; i<n; i++) values[i] = i + 2.0;
const shared_vector<const double> ttt(freeze(values));
pvValueRecord->putFrom(ttt);
bitSet->set(0);
cout << "before updateMaster";
cout << " recordValue " << *pvValueRecord << endl;
cout << " copyValue " << *pvValueCopy << endl;
cout << " bitSet " << *bitSet;
cout << endl;
pvCopy->updateMaster(pvStructureCopy,bitSet);
cout << "after updateMaster";
cout << " recordValue " << *pvValueRecord << endl;
cout << " copyValue " << *pvValueRecord << endl;
cout << " bitSet " << *bitSet;
cout << endl;
}