replace destroy by RAII; many implementation changes
This commit is contained in:
@@ -48,6 +48,7 @@ PvaClientNTMultiData::PvaClientNTMultiData(
|
||||
gotTimeStamp(false),
|
||||
isDestroyed(false)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout<< "PvaClientNTMultiData::PvaClientNTMultiData()\n";
|
||||
PVFieldPtr pvValue = pvRequest->getSubField("field.value");
|
||||
if(!pvValue) {
|
||||
throw std::runtime_error("pvRequest did not specify value");
|
||||
@@ -88,19 +89,19 @@ PvaClientNTMultiData::PvaClientNTMultiData(
|
||||
|
||||
PvaClientNTMultiData::~PvaClientNTMultiData()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void PvaClientNTMultiData::destroy()
|
||||
{
|
||||
if(PvaClient::getDebug()) cout<< "PvaClientNTMultiData::~PvaClientNTMultiData()\n";
|
||||
{
|
||||
Lock xx(mutex);
|
||||
if(isDestroyed) return;
|
||||
if(isDestroyed) {
|
||||
cerr<< "Why was PvaClientNTMultiData::~PvaClientNTMultiData() called more then once????\n";
|
||||
return;
|
||||
}
|
||||
isDestroyed = true;
|
||||
}
|
||||
pvaClientChannelArray.clear();
|
||||
}
|
||||
|
||||
|
||||
void PvaClientNTMultiData::setStructure(StructureConstPtr const & structure,size_t index)
|
||||
{
|
||||
FieldConstPtr field = structure->getField("value");
|
||||
|
||||
Reference in New Issue
Block a user