44 template<
typename Valtype>
45 boost::property_tree::ptree& operator << ( boost::property_tree::ptree& opt,
const Interval<Valtype>& i );
46 template<
typename Valtype>
47 boost::property_tree::ptree& operator >> ( boost::property_tree::ptree& ipt,
Interval<Valtype>& i );
50 template<
typename Valtype>
inline
51 boost::property_tree::ptree& operator << ( boost::property_tree::ptree& opt,
const Interval<Valtype>& i ){
52 boost::property_tree::ptree ptInterval;
54 ptInterval.add(
"<xmlattr>.near", i.
Near() );
55 ptInterval.add(
"<xmlattr>.far", i.
Far() );
57 opt.add_child(
"Interval", ptInterval );
61 template<
typename Valtype>
inline
62 boost::property_tree::ptree& operator >> ( boost::property_tree::ptree& ipt,
Interval<Valtype>& i ){
63 for(
auto iter = ipt.begin(); iter != ipt.end(); ++iter ){
64 if( (*iter).first ==
"Interval" )
66 i.
m_Near = (*iter).second.get(
"<xmlattr>.near", Valtype{0} );
67 i.
m_Far = (*iter).second.get(
"<xmlattr>.far", Valtype{0} );
73 assert( !
"Syntax error: no Interval tag!" );
78 template<
typename Valtype>
inline
80 interval.
Near( pt.get(
"<xmlattr>.near", Valtype{0} ) );
81 interval.
Far( pt.get(
"<xmlattr>.far", Valtype{0} ) );