32#ifndef RDKIT_RDVALUE_H
33#define RDKIT_RDVALUE_H
48 return *v.
ptrCast<std::string>();
50 throw std::bad_any_cast();
56 return *v.
ptrCast<std::string>();
58 throw std::bad_any_cast();
65 return *v.ptrCast<std::vector<double>>();
67 throw std::bad_any_cast();
74 return *v.ptrCast<std::vector<double>>();
76 throw std::bad_any_cast();
82 return *v.ptrCast<std::vector<float>>();
84 throw std::bad_any_cast();
91 return *v.ptrCast<std::vector<float>>();
93 throw std::bad_any_cast();
100 return *v.ptrCast<std::vector<std::string>>();
102 throw std::bad_any_cast();
108 if (
rdvalue_is<std::vector<std::string>>(v)) {
109 return *v.ptrCast<std::vector<std::string>>();
111 throw std::bad_any_cast();
117 return *v.ptrCast<std::vector<int>>();
119 throw std::bad_any_cast();
125 return *v.ptrCast<std::vector<int>>();
127 throw std::bad_any_cast();
133 if (
rdvalue_is<std::vector<unsigned int>>(v)) {
134 return *v.ptrCast<std::vector<unsigned int>>();
136 throw std::bad_any_cast();
142 if (
rdvalue_is<std::vector<unsigned int>>(v)) {
143 return *v.ptrCast<std::vector<unsigned int>>();
145 throw std::bad_any_cast();
154 throw std::bad_any_cast();
162 throw std::bad_any_cast();
170 throw std::bad_any_cast();
178 std::ostringstream
sstr;
179 sstr.imbue(std::locale(
"C"));
180 sstr << std::setprecision(17);
183 std::copy(
tv.begin(),
tv.end() - 1, std::ostream_iterator<T>(
sstr,
","));
206#ifdef RDVALUE_HASBOOL
239 }
catch (
const std::bad_any_cast &) {
241 if (
rdtype ==
typeid(
long)) {
242 res = boost::lexical_cast<std::string>(
245 res = boost::lexical_cast<std::string>(
248 res = boost::lexical_cast<std::string>(
250 }
else if (
rdtype ==
typeid(
unsigned long)) {
251 res = boost::lexical_cast<std::string>(
268typename boost::enable_if<boost::is_arithmetic<T>, T>::type
from_rdvalue(
275 }
catch (
const std::bad_any_cast &
exc) {
289typename boost::disable_if<boost::is_arithmetic<T>, T>::type
from_rdvalue(
static const boost::uint64_t UnsignedIntTag
static const boost::uint64_t StringTag
static const boost::uint64_t VecStringTag
static const boost::uint64_t VecIntTag
static const boost::uint64_t FloatTag
static const boost::uint64_t VecUnsignedIntTag
static const boost::uint64_t DoubleTag
static const boost::uint64_t IntTag
static const boost::uint64_t AnyTag
static const boost::uint64_t VecFloatTag
static const boost::uint64_t VecDoubleTag
static const boost::uint64_t BoolTag
int rdvalue_cast< int >(RDValue_cast_t v)
unsigned int rdvalue_cast< unsigned int >(RDValue_cast_t v)
std::string rdvalue_cast< std::string >(RDValue_cast_t v)
bool rdvalue_is(const RDValue_cast_t)
std::string vectToString(RDValue val)
std::any rdvalue_cast< std::any >(RDValue_cast_t v)
double rdvalue_cast< double >(RDValue_cast_t v)
bool rdvalue_tostring(RDValue_cast_t val, std::string &res)
const std::any & rdvalue_cast< const std::any & >(RDValue_cast_t v)
std::any & rdvalue_cast< std::any & >(RDValue_cast_t v)
std::string & rdvalue_cast< std::string & >(RDValue_cast_t v)
bool rdvalue_cast< bool >(RDValue_cast_t v)
float rdvalue_cast< float >(RDValue_cast_t v)
boost::enable_if< boost::is_arithmetic< T >, T >::type from_rdvalue(RDValue_cast_t arg)
bool rdvalue_is< std::any >(RDValue_cast_t v)
boost::uint64_t getTag() const