当前位置: 首页>>代码示例>>C++>>正文


C++ PVRecordPtr::destroy方法代码示例

本文整理汇总了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();
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:7,代码来源:testPVRecord.cpp

示例2: scalarTest

static void scalarTest()
{
    cout << endl << endl << "****scalarTest****" << endl;
    PVRecordPtr pvRecord;
    pvRecord = createScalar("doubleRecord",pvDouble,"alarm,timeStamp.display");
    pvRecord->destroy();
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:7,代码来源:testPVRecord.cpp

示例3: powerSupplyTest

static void powerSupplyTest()
{
    cout << endl << endl << "****powerSupplyTest****" << endl;
    PVRecordPtr pvRecord;
    PVStructurePtr pv = createPowerSupply();
    pvRecord = PowerSupply::create("powerSupply",pv);
    pvRecord->destroy();
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:8,代码来源:testPVRecord.cpp

示例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();
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:11,代码来源:testPVRecord.cpp

示例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();
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:11,代码来源:testPVRecord.cpp

示例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();
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:12,代码来源:testPVRecord.cpp

示例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;
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:16,代码来源:pvDatabase.cpp

示例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();
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:17,代码来源:pvDatabase.cpp

示例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;
    }
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:23,代码来源:pvDatabase.cpp

示例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;
    }
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:24,代码来源:pvDatabase.cpp

示例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();
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:36,代码来源:testPVCopy.cpp

示例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();
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:82,代码来源:testExampleRecord.cpp


注:本文中的PVRecordPtr::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。