Alan,

It's because these three functions are callback functions which are 
called from another plplot function. They do not operate directly on
a stream.

The C++ class maintains a stream variable for each instance of the 
PLStream class. This means you can have multiple streams (i.e. windows 
/ files) and not have to worry which one plplot is currently using. 
It's all hidden in the object orientation by calling set_stream 
each time a plplot API function is called for a particular object.

The callback functions don't need to do this since they are being 
called from another plplot function. If you look in plstream.h 
you will see these functions are marked static which means there 
is a single copy of the function shared across all instances which
does not have access to the local variables in the class. This
means that calling set_stream wouldn't actually work anyway, 
enforcing this distinction. Uncommenting would generate a compiler
error.

Andrew

On Thu, Oct 16, 2014 at 10:54:43AM -0700, Alan Irwin wrote:
> Hi Andrew:
> 
> I just noticed that the set_stream() call was commented out in
> bindings/c++/plstream.cc for plstream::fill, plstream::fill3, and
> plstream::gradient while it appears in all (as far as I can tell) other
> calls.  Why are those 3 functions exceptions, or is this a minor bug
> that has progated from plstream::fill to the rest?
> 
> Note, I don't have any deep understanding of what set_stream does
> (other than what its name implies), but the above seemed a peculiar
> pattern to me which should be brought to your attention.
> 
> Alan
> __________________________
> Alan W. Irwin
> 
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
> 
> Programming affiliations with the FreeEOS equation-of-state
> implementation for stellar interiors (freeeos.sf.net); the Time
> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
> software package (plplot.sf.net); the libLASi project
> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
> and the Linux Brochure Project (lbproject.sf.net).
> __________________________
> 
> Linux-powered Science
> __________________________
> 
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to