Re: wave copies

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
On Sunday 15 June 2014, Felix Salfelder wrote:
> On Sun, Jun 15, 2014 at 11:35:12PM +0530, Abhinav singh wrote:
> > I tried to store created graph structure  in a map though
> > successful but have to change when Mr. Davis pointed out
> > to use wave directly.Now wave data changes with each
> > simulation and this data is directly used for plotting. So
> > plot will also change with changing data as dynamic
> > plotting is on here.

interesting.  Perhaps this is a useful feature.

Hints at how to do iplot?

> maybe "use wave directly" means "use the wave class directly"
> and not "use the instance of the wave (that is subject to
> change) directly". converting wave data into a custom map
> doesn't sound very useful indeed.

could be.

You can't be sure until you try it.

> so how about stashing waves-to-be-plotted within the gtk/gui
> process as i suggested?

Copying a wave:

// get a pointer to the wave, as you do now.
WAVE* w = find_wave();

// returns NULL if it fails,  (I need to change this)
if (w) {

// now copy it into a local
WAVE wcopy(*w);

// or copy it to something that remains after the function exits
WAVE* wcopyptr(new WAVE(*w));

// handle when find_wave fails
}else{untested();
}


Oops ... the WAVE copy constructor is not implemented and 
blocked.

Need to implement it:

inline WAVE::WAVE(const WAVE& X)
  :_w(X._w),
   _delay(X._delay)
{untested();
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.