本文整理汇总了C++中PVRecordPtr::destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ PVRecordPtr::destroy方法的具体用法?C++ PVRecordPtr::destroy怎么用?C++ PVRecordPtr::destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVRecordPtr
的用法示例。
在下文中一共展示了PVRecordPtr::destroy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: arrayTest
static void arrayTest()
{
cout << endl << endl << "****arrayTest****" << endl;
PVRecordPtr pvRecord;
pvRecord = createScalarArray("doubleArrayRecord",pvDouble,"alarm,timeStamp");
pvRecord->destroy();
}
示例2: scalarTest
static void scalarTest()
{
cout << endl << endl << "****scalarTest****" << endl;
PVRecordPtr pvRecord;
pvRecord = createScalar("doubleRecord",pvDouble,"alarm,timeStamp.display");
pvRecord->destroy();
}
示例3: powerSupplyTest
static void powerSupplyTest()
{
cout << endl << endl << "****powerSupplyTest****" << endl;
PVRecordPtr pvRecord;
PVStructurePtr pv = createPowerSupply();
pvRecord = PowerSupply::create("powerSupply",pv);
pvRecord->destroy();
}
示例4: arrayTest
static void arrayTest()
{
if(debug) {cout << endl << endl << "****arrayTest****" << endl; }
PVRecordPtr pvRecord;
pvRecord = createScalarArray("doubleArrayRecord",pvDouble,"alarm,timeStamp");
testOk1(pvRecord.get()!=0);
if(pvRecord && debug) {
cout << pvRecord << endl;
}
pvRecord->destroy();
}
示例5: scalarTest
static void scalarTest()
{
if(debug) {cout << endl << endl << "****scalarTest****" << endl; }
PVRecordPtr pvRecord;
pvRecord = createScalar("doubleRecord",pvDouble,"alarm,timeStamp.display");
testOk1(pvRecord.get()!=0);
if(pvRecord && debug) {
cout << pvRecord << endl;
}
pvRecord->destroy();
}
示例6: powerSupplyTest
static void powerSupplyTest()
{
if(debug) {cout << endl << endl << "****powerSupplyTest****" << endl; }
PVRecordPtr pvRecord;
PVStructurePtr pv = createPowerSupply();
pvRecord = PowerSupply::create("powerSupply",pv);
testOk1(pvRecord.get()!=0);
if(pvRecord && debug) {
cout << pvRecord << endl;
}
pvRecord->destroy();
}
示例7: removeRecord
bool PVDatabase::removeRecord(PVRecordPtr const & record)
{
epicsGuard<epics::pvData::Mutex> guard(mutex);
if(isDestroyed) {
return false;
}
string recordName = record->getRecordName();
PVRecordMap::iterator iter = recordMap.find(recordName);
if(iter!=recordMap.end()) {
PVRecordPtr pvRecord = (*iter).second;
recordMap.erase(iter);
if(pvRecord) pvRecord->destroy();
return true;
}
return false;
}
示例8: destroy
void PVDatabase::destroy()
{
{
epicsGuard<epics::pvData::Mutex> guard(mutex);
if(isDestroyed) {
return;
}
isDestroyed = true;
}
for(PVRecordMap::iterator iter = recordMap.begin(); iter != recordMap.end(); iter++) {
PVRecordPtr pvRecord = (*iter).second;
if(pvRecord) {
pvRecord->destroy();
}
}
recordMap.clear();
}
示例9: destroy
void PVDatabase::destroy()
{
lock();
try {
if(isDestroyed) {
unlock();
return;
}
isDestroyed = true;
PVRecordMap::iterator iter;
while(true) {
iter = recordMap.begin();
if(iter==recordMap.end()) break;
PVRecordPtr pvRecord = (*iter).second;
recordMap.erase(iter);
if(pvRecord.get()!=NULL) pvRecord->destroy();
}
unlock();
} catch (...) {
unlock();
throw;
}
}
示例10: removeRecord
bool PVDatabase::removeRecord(PVRecordPtr const & record)
{
lock();
try {
if(isDestroyed) {
unlock();
return false;
}
string recordName = record->getRecordName();
PVRecordMap::iterator iter = recordMap.find(recordName);
if(iter!=recordMap.end()) {
PVRecordPtr pvRecord = (*iter).second;
recordMap.erase(iter);
if(pvRecord.get()!=NULL) pvRecord->destroy();
unlock();
return true;
}
unlock();
return false;
} catch(...) {
unlock();
throw;
}
}
示例11: 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();
}
示例12: 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();
}