13#ifndef ML_PROPERTY_VALUE_H
14#define ML_PROPERTY_VALUE_H
26#include <boost/ref.hpp>
27#include <boost/tuple/tuple.hpp>
28#include <boost/variant.hpp>
29#include <boost/mpl/contains.hpp>
30#include <boost/mpl/for_each.hpp>
31#include <boost/mpl/less_equal.hpp>
32#include <boost/mpl/integral_c.hpp>
33#include <boost/mpl/vector.hpp>
34#include <boost/mpl/sizeof.hpp>
41 typedef boost::mpl::vector<MLint8, MLuint8, MLint16, MLuint16, MLint32, MLuint32, MLuint64, MLint64, double, Vector3, Vector6>
SupportedPropertyTypes;
53 return boost::get<StoredType>(_variant);
59 return boost::get<StoredType>(_variant);
62 template<
typename VisitorType>
65 template<
typename VisitorType>
68 template<
typename VisitorType>
71 template<
typename VisitorType>
74 size_t which()
const {
return static_cast<size_t>(_variant.which()); }
77 typedef boost::mpl::transform< SupportedPropertyTypes, lightweight::make_lightweight >::type LightweightPropertyTypes;
78 typedef boost::make_variant_over<LightweightPropertyTypes>::type LightweightVariantType;
79 LightweightVariantType _variant;
Class PropertyValue, which is used to hold properties of a given set of allowed types in typesafe way...
PropertyValue(const T &initialValue)
VisitorType::result_type apply(VisitorType &visitor)
VisitorType::result_type apply(VisitorType &visitor) const
VisitorType::result_type apply(const VisitorType &visitor) const
bool operator==(const PropertyValue &other) const
boost::mpl::vector< MLint8, MLuint8, MLint16, MLuint16, MLint32, MLuint32, MLuint64, MLint64, double, Vector3, Vector6 > SupportedPropertyTypes
VisitorType::result_type apply(const VisitorType &visitor)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_BEGIN_NAMESPACE
VisitorType::result_type apply_visitor(VisitorType &visitor, VariantType &value)
boost::mpl::if_< typenameboost::mpl::less_equal< boost::mpl::sizeof_< T >, boost::mpl::int_< 8 > >::type, T, heap_storage< T > >::type type