29 #ifndef CPP_INTROSPECTION_CONVERSION_H 30 #define CPP_INTROSPECTION_CONVERSION_H 32 #include <boost/type_traits.hpp> 33 #include <boost/utility/enable_if.hpp> 40 typename Enabled =
void 43 static OtherT
to(
const Type&
type,
const boost::any& value) {
return OtherT(); }
44 static boost::any
from(
const Type&
type,
const OtherT& value) {
return boost::any(); }
48 template <
typename OtherT>
56 template <
typename OtherT>
58 static OtherT
to(
const Type&
type,
const boost::any& value) {
return OtherT(type.
as_int(value)); }
63 template <
typename OtherT>
81 #endif // CPP_INTROSPECTION_CONVERSION_H
TargetType as(const boost::any &value) const
virtual int as_int(const boost::any &value) const =0
virtual std::string as_string(const boost::any &value) const =0
static boost::any from(const Type &type, const OtherT &value)
boost::any from(const SourceType &value) const
static boost::any from(const Type &type, const std::string &value)
static std::string to(const Type &type, const boost::any &value)
static OtherT to(const Type &type, const boost::any &value)
virtual double as_double(const boost::any &value) const =0
virtual boost::any from_int(int value) const =0
TypePtr type(const std::string &name)
static OtherT to(const Type &type, const boost::any &value)
virtual boost::any from_string(const std::string &value) const =0
virtual unsigned as_unsigned(const boost::any &value) const =0
static boost::any from(const Type &type, const OtherT &value)
virtual boost::any from_double(double value) const =0
virtual boost::any from_unsigned(unsigned value) const =0
static OtherT to(const Type &type, const boost::any &value)
static boost::any from(const Type &type, const OtherT &value)
static boost::any from(const Type &type, const OtherT &value)
static OtherT to(const Type &type, const boost::any &value)