36#include <boost/property_tree/ptree.hpp>
38#include "dim/support/DimSupportStream.h"
41namespace ptreesupport{
52 template<
int L,
int M,
int T>
53 Value<Dimension<L,M,T>> get(
54 const boost::property_tree::ptree& pt,
55 boost::property_tree::ptree::path_type path,
56 Value<Dimension<L,M,T>> defaultValue = Value<Dimension<L,M,T>>{0},
57 Value<Dimension<L,M,T>> (*defaultUnits)(
Real ) = DefaultUnit<L,M,T>::GetDefaultStreamInDimension() )
59 common::Resetter<typename DefaultUnit<L,M,T>::StreamInDimension> resetter{ DefaultUnit<L,M,T>::GetDefaultStreamInDimension(), defaultUnits };
60 if(
auto result = pt.get_optional<Value<Dimension<L,M,T>>>( path ) )
65 template<
int L,
int M,
int T>
66 boost::optional<Value<Dimension<L,M,T>>> get_optional(
67 const boost::property_tree::ptree& pt,
68 boost::property_tree::ptree::path_type path,
69 Value<Dimension<L,M,T>> (*defaultUnits)(
Real ) )
71 common::Resetter<typename DefaultUnit<L,M,T>::StreamInDimension> resetter{ DefaultUnit<L,M,T>::GetDefaultStreamInDimension(), defaultUnits };
72 return pt.get_optional<Value<Dimension<L,M,T>>>( path );
The namespace provides classes and methods for the dim library.
Definition DimensionedValues.h:178
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190