EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Epics 4 pvd::shared-vector , Can't freeze non-unique vector
From: Heinz Junkes via Tech-talk <[email protected]>
To: tech-talk <[email protected]>
Date: Tue, 16 Apr 2019 14:36:05 +0200
I don't think I understand the shared vectors thing yet
and I can't get any further here.

I defined 

 epics::pvData::shared_vector<double> xData, yData;

Populate vector like
  
xData.push_back(vCh[1][i] - vCh[0][i]);
yData.push_back(vCh[2][i] - vCh[3][i]); 

Then call

 ClPut->put(counter, xData, yData);


Is defined 

void put(long long val, shared_vector<double> xData, shared_vector<double> yData)
    {
…

Here I am doing

PVDoubleArrayPtr pvDoubleArray = static_pointer_cast<PVDoubleArray>(pvField); 
          
pvDoubleArray->replace(freeze(xData));

But this leads to :

		Can't freeze non-unique vector

When I use 

pvDoubleArray->swap(freeze(xData));

This leads to compile error:
../iChunk.h: In member function 'void ClientPut::put(long long int, epics::pvData::shared_vector<double>, epics::pvData::shared_vector<double>)':
../iChunk.h:188:53: error: cannot bind non-const lvalue reference of type 'epics::pvData::PVValueArray<double>::const_svector& {aka epics::pvData::shared_vector<const double>&}' to an rvalue of type 'epics::pvData::shared_vector<const double>'
              pvDoubleArray->swap(freeze(xData));

Danke,
Heinz

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Replies:
Re: Epics 4 pvd::shared-vector , Can't freeze non-unique vector Heinz Junkes via Tech-talk

Navigate by Date:
Prev: Re: Stopping IOC boot on failure to load database Mooney, Tim M. via Tech-talk
Next: Re: Epics 4 pvd::shared-vector , Can't freeze non-unique vector Heinz Junkes via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Stopping IOC boot on failure to load database Benjamin Franksen via Tech-talk
Next: Re: Epics 4 pvd::shared-vector , Can't freeze non-unique vector Heinz Junkes via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024