Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
absolute.hpp File Reference

Absolute units (points rather than vectors). More...

#include <iosfwd>
#include <boost/units/detail/absolute_impl.hpp>
Include dependency graph for absolute.hpp:
This graph shows which files directly or indirectly include this file:

Classes

singleton  boost::units::absolute< Y >
 A wrapper to represent absolute units (points rather than vectors). More...
 

Namespaces

 boost
 Duration formatting facet for input.
 
 boost::units
 

Macros

#define BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_)
 Macro to define the offset between two absolute units. More...
 

Functions

template<class Y >
absolute< Y > boost::units::operator+ (const absolute< Y > &aval, const Y &rval)
 add a relative value to an absolute one More...
 
template<class Y >
absolute< Y > boost::units::operator+ (const Y &rval, const absolute< Y > &aval)
 add a relative value to an absolute one More...
 
template<class Y >
absolute< Y > boost::units::operator- (const absolute< Y > &aval, const Y &rval)
 subtract a relative value from an absolute one More...
 
template<class Y >
boost::units::operator- (const absolute< Y > &aval1, const absolute< Y > &aval2)
 subtracting two absolutes gives a difference More...
 
template<class D , class S , class T >
quantity< absolute< unit< D, S >
>, T
boost::units::operator* (const T &t, const absolute< unit< D, S > > &)
 creates a quantity from an absolute unit and a raw value More...
 
template<class D , class S , class T >
quantity< absolute< unit< D, S >
>, T
boost::units::operator* (const absolute< unit< D, S > > &, const T &t)
 creates a quantity from an absolute unit and a raw value More...
 
template<class Char , class Traits , class Y >
std::basic_ostream< Char,
Traits > & 
boost::units::operator<< (std::basic_ostream< Char, Traits > &os, const absolute< Y > &aval)
 Print an absolute unit. More...
 

Detailed Description

Absolute units (points rather than vectors).

Operations between absolute units, and relative units like temperature differences.

Macro Definition Documentation

#define BOOST_UNITS_DEFINE_CONVERSION_OFFSET (   From,
  To,
  type_,
  value_ 
)
Value:
namespace boost { \
namespace units { \
template<> \
struct affine_conversion_helper< \
{ \
static const bool is_defined = true; \
typedef type_ type; \
static type value() { return(value_); } \
}; \
} \
} \
void boost_units_require_semicolon()
void
Definition: is_convertible.hpp:460
Duration formatting facet for input.
Definition: accumulators_fwd.hpp:55
typed_value< T > * value()
Creates a typed_value instance.
adjacency_iterator typedef T::adjacency_iterator type
Definition: graph_traits.hpp:42

Macro to define the offset between two absolute units.

Requires the value to be in the destination units e.g

1 BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0);

BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to specify the conversion factor. Like BOOST_UNITS_DEFINE_CONVERSION_FACTOR this macro defines both forward and reverse conversions so defining, e.g., the conversion from celsius to fahrenheit as above will also define the inverse conversion from fahrenheit to celsius.