本文整理汇总了C++中PVRecordPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PVRecordPtr::get方法的具体用法?C++ PVRecordPtr::get怎么用?C++ PVRecordPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVRecordPtr
的用法示例。
在下文中一共展示了PVRecordPtr::get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: lockOtherRecord
void PVRecord::lockOtherRecord(PVRecordPtr const & otherRecord)
{
if(traceLevel>2) {
cout << "PVRecord::lockOtherRecord() " << recordName << endl;
}
if(this<otherRecord.get()) {
otherRecord->lock();
return;
}
unlock();
otherRecord->lock();
lock();
}
示例5: channelFind
ChannelFind::shared_pointer ChannelProviderLocal::channelFind(
string const & channelName,
ChannelFindRequester::shared_pointer const &channelFindRequester)
{
Lock xx(mutex);
PVRecordPtr pvRecord = pvDatabase->findRecord(channelName);
if(pvRecord.get()!=NULL) {
channelFindRequester->channelFindResult(
Status::Ok,
channelFinder,
true);
} else {
Status notFoundStatus(Status::STATUSTYPE_ERROR,"pv not found");
channelFindRequester->channelFindResult(
notFoundStatus,
channelFinder,
false);
}
return channelFinder;
}
示例6: 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;
}
}
示例7: createChannel
Channel::shared_pointer ChannelProviderLocal::createChannel(
string const & channelName,
ChannelRequester::shared_pointer const &channelRequester,
short priority,
string const &address)
{
Lock xx(mutex);
PVRecordPtr pvRecord = pvDatabase->findRecord(channelName);
if(pvRecord.get()!=NULL) {
ChannelLocalPtr channel(new ChannelLocal(
getPtrSelf(),channelRequester,pvRecord));
channelRequester->channelCreated(
Status::Ok,
channel);
pvRecord->addPVRecordClient(channel);
return channel;
}
Status notFoundStatus(Status::STATUSTYPE_ERROR,"pv not found");
channelRequester->channelCreated(
notFoundStatus,
Channel::shared_pointer());
return Channel::shared_pointer();
}
示例8: 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;
}
}