Boost logo

Boost Users :

Subject: Re: [Boost-users] [Units] Variant based runtime analysis
From: gast128 (gast128_at_[hidden])
Date: 2011-03-01 10:52:09


Samuel Debionne <debionne <at> hydrowide.com> writes:

> Runtime conversion are also something I am interrested. Are you
> following the lead of :
>
http://www.boost.org/doc/libs/1_46_0/doc/html/boost_units/Examples.html#boost_u
nits.Examples.RuntimeUnits
>
> I think that we could layer things this way :
>
> LAYER 3: any_quantity<heterogeneous_units>
> runtime dimensional analysis and conversion
>
> LAYER 2: any_quantity<homogeneous_dimension_units>
> compile time dimensional analysis and runtime conversion
>
> LAYER 1: quantity<unit>
> the actual library
>

Fwiw: this runtime variant would be really welcome. In our application we
calculate some data with various units (e.g. m/s, m) which gets plotted. The
plotter just talks to the base class of the data, like:

struct Data
{
   Unit GetUnit () const;
   double GetValue(size_t nIndex) const;
};

Also the user is able to specify his display units (e.g. cm instead of m), and
we use the runtime unit for scaling the physical quantities.

(snipped some quoted stuff, gmane reports: 'There's much more quoted text in
your article than new. Prune quoted stuff.')


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net