EPICS Controls Argonne National Laboratory

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: Re: Epics 4 pvd::shared-vector , Can't freeze non-unique vector
From: Heinz Junkes via Tech-talk <[email protected]>
To: Heinz Junkes <[email protected]>
Cc: tech-talk <[email protected]>
Date: Tue, 16 Apr 2019 15:44:06 +0200
Danke found it my self ;-)

  void put(long long val, shared_vector<const double> const & xData, shared_vector<const double> const & yData)


 shared_vector<double> valx(minSize);
        for (unsigned int i = 0; i < minSize; i++){
          valx[i] = (vCh[1][i] - vCh[0][i]);
        }

shared_vector<double> valy(minSize);
        for (unsigned int i = 0; i < minSize; i++) {
          valy[i] = (vCh[2][i] - vCh[3][i]);
        }

  ClPut->put(counter, freeze(valx), freeze(valy));


> On 16. Apr 2019, at 14:36, Heinz Junkes via Tech-talk <[email protected]> wrote:
> 
> 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


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

Navigate by Date:
Prev: Epics 4 pvd::shared-vector , Can't freeze non-unique vector Heinz Junkes via Tech-talk
Next: Current transducer Box asynPortDriver using tcp and udp timing out Bernal Ruiz, Enrique 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: Epics 4 pvd::shared-vector , Can't freeze non-unique vector Heinz Junkes via Tech-talk
Next: Current transducer Box asynPortDriver using tcp and udp timing out Bernal Ruiz, Enrique 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 
ANJ, 16 Apr 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·