本文整理汇总了C++中PVRecordPtr::process方法的典型用法代码示例。如果您正苦于以下问题:C++ PVRecordPtr::process方法的具体用法?C++ PVRecordPtr::process怎么用?C++ PVRecordPtr::process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVRecordPtr
的用法示例。
在下文中一共展示了PVRecordPtr::process方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: putGet
void ChannelPutGetLocal::putGet(
PVStructurePtr const &pvPutStructure,BitSetPtr const &putBitSet)
{
ChannelPutGetRequester::shared_pointer requester = channelPutGetRequester.lock();
if(!requester) return;
if(isDestroyed) {
requester->putGetDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
try {
{
epicsGuard <PVRecord> guard(*pvRecord);
pvRecord->beginGroupPut();
pvPutCopy->updateMaster(pvPutStructure, putBitSet);
if(callProcess) pvRecord->process();
getBitSet->clear();
pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet);
pvRecord->endGroupPut();
}
requester->putGetDone(
Status::Ok,getPtrSelf(),pvGetStructure,getBitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelPutGetLocal::putGet" << endl;
}
} catch(std::exception& ex) {
Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
requester->putGetDone(status,getPtrSelf(),pvGetStructure,getBitSet);
}
}
示例2: get
void ChannelGetLocal::get()
{
ChannelGetRequester::shared_pointer requester = channelGetRequester.lock();
if(!requester) return;
if(isDestroyed) {
requester->getDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
try {
bitSet->clear();
{
epicsGuard <PVRecord> guard(*pvRecord);
if(callProcess) {
pvRecord->beginGroupPut();
pvRecord->process();
pvRecord->endGroupPut();
}
pvCopy->updateCopySetBitSet(pvStructure, bitSet);
}
if(firstTime) {
bitSet->clear();
bitSet->set(0);
firstTime = false;
}
requester->getDone(
Status::Ok,
getPtrSelf(),
pvStructure,
bitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelGetLocal::get" << endl;
}
} catch(std::exception& ex) {
Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
requester->getDone(status,getPtrSelf(),pvStructure,bitSet);
}
}
示例3: test
static void test()
{
StandardPVFieldPtr standardPVField = getStandardPVField();
string properties;
ScalarType scalarType;
string recordName;
properties = "alarm,timeStamp";
scalarType = pvDouble;
recordName = "exampleDouble";
PVStructurePtr pvStructure;
pvStructure = standardPVField->scalar(scalarType,properties);
PVRecordPtr exampleRecord = PVRecord::create(recordName,pvStructure);
exampleRecord->setTraceLevel(traceLevel);
RecordClientPtr exampleRecordClient(RecordClient::create(exampleRecord));
ListenerPtr exampleListener(Listener::create(exampleRecord));
{
exampleRecord->lock();
exampleRecord->process();
exampleRecord->unlock();
}
if(debug) {cout << "processed exampleDouble " << endl; }
exampleRecord->destroy();
recordName = "powerSupplyExample";
PowerSupplyPtr psr;
pvStructure = createPowerSupply();
psr = PowerSupply::create("powerSupply",pvStructure);
psr->setTraceLevel(traceLevel);
RecordClientPtr psrRecordClient(RecordClient::create(psr));
ListenerPtr psrListener(Listener::create(psr));
testOk1(psr.get()!=0);
if(!psr) {
if(debug) {cout << "PowerSupplyRecordTest::create failed" << endl;}
return;
}
double voltage,power,current;
{
psr->lock();
voltage = psr->getVoltage();
power = psr->getPower();
current = psr->getCurrent();
psr->unlock();
}
if(debug ) {
cout << "initial ";
cout << " voltage " << voltage ;
cout << " power " << power;
cout << " current " << current;
cout << endl;
}
testOk1(psr->getVoltage()==0.0);
testOk1(psr->getPower()==0.0);
testOk1(psr->getCurrent()==0.0);
voltage = 1.0;
power = 1.0;
if(debug) {
cout << "before put ";
cout << " voltage " << voltage ;
cout << " power " << power;
cout << endl;
}
{
psr->lock();
psr->put(power,voltage);
psr->process();
psr->unlock();
}
{
psr->lock();
if(debug) {
cout << "after put ";
cout << " voltage " << psr->getVoltage() ;
cout << " power " << psr->getPower();
cout << " current " << psr->getCurrent();
cout << endl;
}
psr->unlock();
}
testOk1(psr->getVoltage()==1.0);
testOk1(psr->getPower()==1.0);
testOk1(psr->getCurrent()==1.0);
psr->destroy();
}