needed clone instead of copy

This commit is contained in:
Marty Kraimer
2015-03-20 16:28:33 -04:00
parent 8f054db6cd
commit 6a351cb5a2
3 changed files with 12 additions and 8 deletions
+2 -2
View File
@@ -54,10 +54,10 @@ static void testGood(EasyPVAPtr const &easyPVA)
EasyNTMultiChannelPtr easy = EasyNTMultiChannel::create(
easyPVA,pvNames,structure);
NTMultiChannelPtr nt = easy->get();
cout << "initial\n" << nt->getPVStructure() << endl;
for(size_t numtimes=0; numtimes<3; ++numtimes) {
PVUnionArrayPtr pvValue = nt->getPVStructure()->
getSubField<PVUnionArray>("value");
cout << "initial\n" << nt->getPVStructure() << endl;
shared_vector<PVUnionPtr> valueVector = pvValue->reuse();
for(size_t i=0; i<num; ++i)
{
@@ -111,8 +111,8 @@ static void testGood(EasyPVAPtr const &easyPVA)
pvValue->replace(freeze(valueVector));
easy->put(nt);
nt = easy->get();
cout << "after put\n" << nt->getPVStructure() << endl;
}
cout << "final\n" << nt->getPVStructure() << endl;
} catch (std::runtime_error e) {
cout << "exception " << e.what() << endl;
isOk = false;