RDKit: RDValue-doublemagic.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
RDValue-doublemagic.h
Go to the documentation of this file.
1// Copyright (c) 2015, Novartis Institutes for BioMedical Research Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following
12// disclaimer in the documentation and/or other materials provided
13// with the distribution.
14// * Neither the name of Novartis Institutes for BioMedical Research Inc.
15// nor the names of its contributors may be used to endorse or promote
16// products derived from this software without specific prior written
17// permission.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30//
31#include <RDGeneral/export.h>
32#ifndef RDKIT_RDVALUE_PTRMAGIC_H
33#define RDKIT_RDVALUE_PTRMAGIC_H
34
35#include <cstdint>
36#include <cassert>
37#include <any>
38#include "Invariant.h"
39#include <iomanip>
40#include <sstream>
41#include <vector>
42#include <string>
43#include <RDGeneral/BoostStartInclude.h>
44#include <boost/utility.hpp>
45#include <boost/lexical_cast.hpp>
46#include <boost/type_traits.hpp>
47#include <boost/static_assert.hpp>
48#include <RDGeneral/BoostEndInclude.h>
49#include <cmath>
50#include "LocaleSwitcher.h"
51
52#define RDVALUE_HASBOOL
53
54namespace RDKit {
55
56// Inspired by
57// https://nikic.github.io/2012/02/02/Pointer-magic-for-efficient-dynamic-value-representations.html
58// 16 bit storage for value types using Quiet NaN spaces in
59// doubles
60// Won't work on Solaris and some other os's as mmaping maps from
61// top memory down
62// Example check:
63// std::string *pointer = new std::string(v);
64// assert((reinterpret_cast<boost::uint64_t>(pointer) & StringTag) == 0);
65
66// implementations, need a typedef at compile time to figure this out.
67// current implementation is probably little endian, need to check.
68
69/*
70 Encoding for storing other things as a double. Use
71 Quiet NaN
72 Quiet NaN: // used to encode types
73 F F F 1XXX < - X = type bits (first bit is set to one)
74
75 seeeeeee|eeeemmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm
76 s1111111|11111ppp|pppppppp|pppppppp|pppppppp|pppppppp|pppppppp|pppppppp
77 ^- first mantissa bit 1 everything else is "payload" -^
78 ^- exponent bits all 1 and mustn't be all-zero (as it
79 ^- any sign bit would be INF then)
80
81 Available
82 8 = 1000 MaxDouble // Not really a tag, is a sentinel
83 9 = 1001 Float
84 b = 1010 Int32
85 a = 1011 Uint32
86 C = 1100 <none>
87 D = 1101 <none>
88 E = 1110 <none>
89 F = 1111 PtrTag (look at lower 3 bits for type)
90*/
91
92 namespace RDTypeTag {
93 static const boost::uint64_t NaN = 0xfff7FFFFFFFFFFFF; // signalling NaN
94 static const boost::uint64_t MaxDouble = 0xfff8000000000000; //
95 static const boost::uint64_t DoubleTag = 0xfff8000000000000; //
96 static const boost::uint64_t FloatTag = 0xfff9000000000000; //
97 static const boost::uint64_t IntTag = 0xfffa000000000000; //
98 static const boost::uint64_t UnsignedIntTag = 0xfffb000000000000; //
99 static const boost::uint64_t BoolTag = 0xfffc000000000000; //
100
101// PTR Tags use the last 3 bits for typing info
102 static const boost::uint64_t PtrTag = 0xffff000000000000;
103 static const boost::uint64_t StringTag = 0xffff000000000001; // 001
104 static const boost::uint64_t VecDoubleTag = 0xffff000000000002; // 010
105 static const boost::uint64_t VecFloatTag = 0xffff000000000003; // 011
106 static const boost::uint64_t VecIntTag = 0xffff000000000004; // 100
107 static const boost::uint64_t VecUnsignedIntTag = 0xffff000000000005; // 101
108 static const boost::uint64_t VecStringTag = 0xffff000000000006; // 110
109 static const boost::uint64_t AnyTag = 0xffff000000000007; // 111
110
111// Retrieves the tag (and PtrMask) from the type
112template <class T>
113 inline boost::uint64_t GetTag() {
114 return AnyTag;
115}
116template <>
117 inline boost::uint64_t GetTag<double>() {
118 return MaxDouble;
119}
120template <>
121 inline boost::uint64_t GetTag<float>() {
122 return FloatTag;
123}
124template <>
125 inline boost::uint64_t GetTag<int>() {
126 return IntTag;
127}
128template <>
129 inline boost::uint64_t GetTag<unsigned int>() {
130 return UnsignedIntTag;
131}
132template <>
133 inline boost::uint64_t GetTag<bool>() {
134 return BoolTag;
135}
136template <>
137 inline boost::uint64_t GetTag<std::string>() {
138 return StringTag;
139}
140template <>
141 inline boost::uint64_t GetTag<std::vector<double>>() {
142 return VecDoubleTag;
143}
144template <>
145 inline boost::uint64_t GetTag<std::vector<float>>() {
146 return VecFloatTag;
147}
148template <>
149 inline boost::uint64_t GetTag<std::vector<int>>() {
150 return VecIntTag;
151}
152template <>
153 inline boost::uint64_t GetTag<std::vector<unsigned int>>() {
154 return VecUnsignedIntTag;
155}
156template <>
157 inline boost::uint64_t GetTag<std::vector<std::string>>() {
158 return VecStringTag;
159}
160template <>
161 inline boost::uint64_t GetTag<std::any>() {
162 return AnyTag;
163}
164} // namespace RDTypeTag
165
166 struct RDValue {
167 // Bit Twidling for conversion from the Tag to a Pointer
168 static const boost::uint64_t TagMask = 0xFFFF000000000000;
169 static const boost::uint64_t PointerTagMask = 0xFFFF000000000007;
170 static const boost::uint64_t ApplyMask = 0x0000FFFFFFFFFFFF;
171 static const boost::uint64_t ApplyPtrMask = 0x0000FFFFFFFFFFF8;
172
173 union {
174 double doubleBits;
175 boost::uint64_t otherBits;
176 };
177
178 inline RDValue() : doubleBits(0.0) {}
179
180 inline RDValue(double number) {
181 if (boost::math::isnan(number)) {
182 // Store a signalling NaN for NaN's.
183 // quiet NaNs are used for other types.
184 otherBits = RDTypeTag::NaN;
185 assert(boost::math::isnan(doubleBits));
186 } else {
187 doubleBits = number;
188 }
189 }
190
191 inline RDValue(float number) {
192 otherBits = 0 | RDTypeTag::FloatTag;
193 memcpy(((char *)&otherBits), &number, sizeof(float));
194 }
195
196 inline RDValue(int32_t number) {
197 otherBits = (((boost::uint64_t)number) & ApplyMask) | RDTypeTag::IntTag;
198 }
199
200 inline RDValue(unsigned int number) {
201 otherBits =
202 (((boost::uint64_t)number) & ApplyMask) | RDTypeTag::UnsignedIntTag;
203 }
204
205 inline RDValue(bool number) {
206 otherBits =
207 (static_cast<boost::uint64_t>(number) & ApplyMask) | RDTypeTag::BoolTag;
208 }
209
210 inline RDValue(std::any *pointer) {
211 // ensure that the pointer really is only 48 bit
212 assert((reinterpret_cast<boost::uint64_t>(pointer) & RDTypeTag::AnyTag) ==
213 0);
214 otherBits = reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::AnyTag;
215 }
216
217 inline RDValue(const std::any &any) {
218 // ensure that the pointer really is only 48 bit
219 std::any *pointer = new std::any(any);
220 assert((reinterpret_cast<boost::uint64_t>(pointer) & RDTypeTag::AnyTag) ==
221 0);
222 otherBits = reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::AnyTag;
223 }
224
225 // Unknown types are stored as std::any
226 template <class T>
227 inline RDValue(const T &v) {
228 std::any *pointer = new std::any(v);
229 assert((reinterpret_cast<boost::uint64_t>(pointer) & RDTypeTag::AnyTag) ==
230 0);
231 otherBits = reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::AnyTag;
232 }
233
234 inline RDValue(const std::string &v) {
235 std::string *pointer = new std::string(v);
236 assert((reinterpret_cast<boost::uint64_t>(pointer) &
237 RDTypeTag::StringTag) == 0);
238 otherBits =
239 reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::StringTag;
240 }
241
242 inline RDValue(const std::vector<double> &v) {
243 std::vector<double> *pointer = new std::vector<double>(v);
244 assert((reinterpret_cast<boost::uint64_t>(pointer) &
245 RDTypeTag::VecDoubleTag) == 0);
246 otherBits =
247 reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecDoubleTag;
248 }
249
250 inline RDValue(const std::vector<float> &v) {
251 std::vector<float> *pointer = new std::vector<float>(v);
252 assert((reinterpret_cast<boost::uint64_t>(pointer) &
253 RDTypeTag::VecFloatTag) == 0);
254 otherBits =
255 reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecFloatTag;
256 }
257
258 inline RDValue(const std::vector<int> &v) {
259 std::vector<int> *pointer = new std::vector<int>(v);
260 assert((reinterpret_cast<boost::uint64_t>(pointer) &
261 RDTypeTag::VecIntTag) == 0);
262 otherBits =
263 reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecIntTag;
264 }
265
266 inline RDValue(const std::vector<unsigned int> &v) {
267 std::vector<unsigned int> *pointer = new std::vector<unsigned int>(v);
268 assert((reinterpret_cast<boost::uint64_t>(pointer) &
269 RDTypeTag::VecIntTag) == 0);
270 otherBits = reinterpret_cast<boost::uint64_t>(pointer) |
271 RDTypeTag::VecUnsignedIntTag;
272 }
273
274 inline RDValue(const std::vector<std::string> &v) {
275 std::vector<std::string> *pointer = new std::vector<std::string>(v);
276 assert((reinterpret_cast<boost::uint64_t>(pointer) &
277 RDTypeTag::VecStringTag) == 0);
278 otherBits =
279 reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecStringTag;
280 }
281
282 boost::uint64_t getTag() const {
283 if (otherBits < RDTypeTag::MaxDouble ||
284 (otherBits & RDTypeTag::NaN) == RDTypeTag::NaN) {
285 return RDTypeTag::DoubleTag;
286 }
287
288 boost::uint64_t tag = otherBits & TagMask;
289 if (tag == RDTypeTag::PtrTag) return otherBits & PointerTagMask;
290 return tag;
291 }
292
293 // ptrCast - unsafe, use rdvalue_cast instead.
294 template <class T>
295 inline T *ptrCast() const {
296 return reinterpret_cast<T *>(otherBits & ~RDTypeTag::GetTag<T>());
297 }
298
299 // RDValue doesn't have an explicit destructor, it must
300 // be wrapped in a container.
301 // The idea is that POD types don't need to be destroyed
302 // and this allows the container optimization possibilities.
303 inline void destroy() {
304 switch (getTag()) {
305 case RDTypeTag::StringTag:
306 delete ptrCast<std::string>();
307 break;
308 case RDTypeTag::VecDoubleTag:
309 delete ptrCast<std::vector<double>>();
310 break;
311 case RDTypeTag::VecFloatTag:
312 delete ptrCast<std::vector<float>>();
313 break;
314 case RDTypeTag::VecIntTag:
315 delete ptrCast<std::vector<int>>();
316 break;
317 case RDTypeTag::VecUnsignedIntTag:
318 delete ptrCast<std::vector<unsigned int>>();
319 break;
320 case RDTypeTag::VecStringTag:
321 delete ptrCast<std::vector<std::string>>();
322 break;
323 case RDTypeTag::AnyTag:
324 delete ptrCast<std::any>();
325 break;
326 default:
327 break;
328 }
329 }
330
331 static inline void cleanup_rdvalue(RDValue v) { v.destroy(); }
332};
333
334/////////////////////////////////////////////////////////////////////////////////////
335// Given two RDValue::Values - copy the appropriate structure
336// RDValue doesn't have a copy constructor, the default
337// copy act's like a move for better value semantics.
338// Containers may need to copy though.
339 inline void copy_rdvalue(RDValue &dest, const RDValue &src) {
340 dest.destroy();
341 switch (src.getTag()) {
342 case RDTypeTag::StringTag:
343 dest = RDValue(*src.ptrCast<std::string>());
344 break;
345 case RDTypeTag::VecDoubleTag:
346 dest = RDValue(*src.ptrCast<std::vector<double>>());
347 break;
348 case RDTypeTag::VecFloatTag:
349 dest = RDValue(*src.ptrCast<std::vector<float>>());
350 break;
351 case RDTypeTag::VecIntTag:
352 dest = RDValue(*src.ptrCast<std::vector<int>>());
353 break;
354 case RDTypeTag::VecUnsignedIntTag:
355 dest = RDValue(*src.ptrCast<std::vector<unsigned int>>());
356 break;
357 case RDTypeTag::VecStringTag:
358 dest = RDValue(*src.ptrCast<std::vector<std::string>>());
359 break;
360 case RDTypeTag::AnyTag:
361 dest = RDValue(*src.ptrCast<std::any>());
362 break;
363 default:
364 dest = src;
365 }
366}
367
368/////////////////////////////////////////////////////////////////////////////////////
369// rdvalue_is<T>
370
371template <class T>
372 inline bool rdvalue_is(const RDValue_cast_t) {
373 const short tag =
374 RDTypeTag::GetTag<typename boost::remove_reference<T>::type>();
375 if (v.getTag() == tag) return true;
376
377 // If we are an Any tag, check the any type info
378 if (v.getTag() == RDTypeTag::AnyTag) {
379 return v.value.a->type() == typeid(T);
380 }
381
382 return false;
383}
384
385template <>
386 inline bool rdvalue_is<double>(const RDValue_cast_t) {
387 return v.otherBits < RDTypeTag::MaxDouble ||
388 (v.otherBits & RDTypeTag::NaN) == RDTypeTag::NaN;
389}
390
391template <>
392 inline bool rdvalue_is<const double &>(const RDValue_cast_t) {
393 return rdvalue_is<double>(v);
394}
395
396/*
397template<>
398inline bool rdvalue_is<bool>(const RDValue_cast_t) {
399 return (v.getTag() == RDTypeTag::IntTag &&
400 (static_cast<int32_t>(v.otherBits & ~RDTypeTag::IntTag) == 1 ||
401 static_cast<int32_t>(v.otherBits & ~RDTypeTag::IntTag) == 0 ));
402}
403
404template<>
405inline bool rdvalue_is<const bool&>(const RDValue_cast_t) {
406 return rdvalue_is<bool>(v);
407}
408*/
409
410/////////////////////////////////////////////////////////////////////////////////////
411// rdvalue_cast<T>
412//
413// POD types do not support reference semantics. Other types do.
414// rdvalue_cast<const std::vector<double> &>(RDValue); // ok
415// rdvalue_cast<const float &>(RDValue); // bad_any_cast
416
417 typedef RDValue RDValue_cast_t;
418// Get stuff stored in boost any
419template <class T>
420 inline T rdvalue_cast(RDValue_cast_t v) {
421 // Disable reference and pointer casts to POD data.
422 BOOST_STATIC_ASSERT(!(
423 (boost::is_pointer<T>::value &&
424 (boost::is_integral<typename boost::remove_pointer<T>::type>::value ||
425 boost::is_floating_point<
426 typename boost::remove_pointer<T>::type>::value)) ||
427 (boost::is_reference<T>::value &&
428 (boost::is_integral<typename boost::remove_reference<T>::type>::value ||
429 boost::is_floating_point<
430 typename boost::remove_reference<T>::type>::value))));
431
432 if (rdvalue_is<std::any>(v)) {
433 return std::any_cast<T>(*v.ptrCast<std::any>());
434 }
435 throw std::bad_any_cast();
436}
437
438// POD casts
439template <>
440 inline double rdvalue_cast<double>(RDValue_cast_t v) {
441 if (rdvalue_is<double>(v)) return v.doubleBits;
442 throw std::bad_any_cast();
443}
444
445template <>
446 inline float rdvalue_cast<float>(RDValue_cast_t v) {
447 if (rdvalue_is<float>(v)) {
448 float f;
449 memcpy(&f, ((char *)&v.otherBits), sizeof(float));
450 return f;
451 }
452 throw std::bad_any_cast();
453}
454
455// n.b. with const expressions, could use ~RDTagTypes::GetTag<T>()
456// and enable_if
457template <>
458 inline int rdvalue_cast<int>(RDValue_cast_t v) {
459 if (rdvalue_is<int>(v)) {
460 return static_cast<int32_t>(v.otherBits & ~RDTypeTag::IntTag);
461 }
462 throw std::bad_any_cast();
463}
464template <>
465 inline unsigned int rdvalue_cast<unsigned int>(RDValue_cast_t v) {
466 if (rdvalue_is<unsigned int>(v)) {
467 return static_cast<uint32_t>(v.otherBits & ~RDTypeTag::UnsignedIntTag);
468 }
469 throw std::bad_any_cast();
470}
471
472template <>
473 inline bool rdvalue_cast<bool>(RDValue_cast_t v) {
474 if (rdvalue_is<bool>(v)) {
475 return static_cast<bool>(v.otherBits & ~RDTypeTag::BoolTag);
476 }
477 throw std::bad_any_cast();
478}
479
480} // namespace RDKit
481#endif
BoostEndInclude.h
BoostStartInclude.h
Invariant.h
LocaleSwitcher.h
export.h
RDKit::RDTypeTag
Definition RDValue-doublemagic.h:92
RDKit::RDTypeTag::NaN
static const boost::uint64_t NaN
Definition RDValue-doublemagic.h:93
RDKit::RDTypeTag::GetTag< int >
boost::uint64_t GetTag< int >()
Definition RDValue-doublemagic.h:125
RDKit::RDTypeTag::UnsignedIntTag
static const boost::uint64_t UnsignedIntTag
Definition RDValue-doublemagic.h:98
RDKit::RDTypeTag::StringTag
static const boost::uint64_t StringTag
Definition RDValue-doublemagic.h:103
RDKit::RDTypeTag::GetTag< std::string >
boost::uint64_t GetTag< std::string >()
Definition RDValue-doublemagic.h:137
RDKit::RDTypeTag::MaxDouble
static const boost::uint64_t MaxDouble
Definition RDValue-doublemagic.h:94
RDKit::RDTypeTag::GetTag< bool >
boost::uint64_t GetTag< bool >()
Definition RDValue-doublemagic.h:133
RDKit::RDTypeTag::GetTag< unsigned int >
boost::uint64_t GetTag< unsigned int >()
Definition RDValue-doublemagic.h:129
RDKit::RDTypeTag::GetTag
boost::uint64_t GetTag()
Definition RDValue-doublemagic.h:113
RDKit::RDTypeTag::VecStringTag
static const boost::uint64_t VecStringTag
Definition RDValue-doublemagic.h:108
RDKit::RDTypeTag::GetTag< std::any >
boost::uint64_t GetTag< std::any >()
Definition RDValue-doublemagic.h:161
RDKit::RDTypeTag::VecIntTag
static const boost::uint64_t VecIntTag
Definition RDValue-doublemagic.h:106
RDKit::RDTypeTag::FloatTag
static const boost::uint64_t FloatTag
Definition RDValue-doublemagic.h:96
RDKit::RDTypeTag::VecUnsignedIntTag
static const boost::uint64_t VecUnsignedIntTag
Definition RDValue-doublemagic.h:107
RDKit::RDTypeTag::DoubleTag
static const boost::uint64_t DoubleTag
Definition RDValue-doublemagic.h:95
RDKit::RDTypeTag::GetTag< double >
boost::uint64_t GetTag< double >()
Definition RDValue-doublemagic.h:117
RDKit::RDTypeTag::IntTag
static const boost::uint64_t IntTag
Definition RDValue-doublemagic.h:97
RDKit::RDTypeTag::GetTag< float >
boost::uint64_t GetTag< float >()
Definition RDValue-doublemagic.h:121
RDKit::RDTypeTag::AnyTag
static const boost::uint64_t AnyTag
Definition RDValue-doublemagic.h:109
RDKit::RDTypeTag::PtrTag
static const boost::uint64_t PtrTag
Definition RDValue-doublemagic.h:102
RDKit::RDTypeTag::VecFloatTag
static const boost::uint64_t VecFloatTag
Definition RDValue-doublemagic.h:105
RDKit::RDTypeTag::VecDoubleTag
static const boost::uint64_t VecDoubleTag
Definition RDValue-doublemagic.h:104
RDKit::RDTypeTag::BoolTag
static const boost::uint64_t BoolTag
Definition RDValue-doublemagic.h:99
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::rdvalue_cast< int >
int rdvalue_cast< int >(RDValue_cast_t v)
Definition RDValue-doublemagic.h:458
RDKit::rdvalue_cast< unsigned int >
unsigned int rdvalue_cast< unsigned int >(RDValue_cast_t v)
Definition RDValue-doublemagic.h:465
RDKit::rdvalue_is
bool rdvalue_is(const RDValue_cast_t)
Definition RDValue-doublemagic.h:372
RDKit::rdvalue_cast< double >
double rdvalue_cast< double >(RDValue_cast_t v)
Definition RDValue-doublemagic.h:440
RDKit::rdvalue_is< const double & >
bool rdvalue_is< const double & >(const RDValue_cast_t)
Definition RDValue-doublemagic.h:392
RDKit::copy_rdvalue
void copy_rdvalue(RDValue &dest, const RDValue &src)
Definition RDValue-doublemagic.h:339
RDKit::rdvalue_cast
T rdvalue_cast(RDValue_cast_t v)
Definition RDValue-doublemagic.h:420
RDKit::rdvalue_is< double >
bool rdvalue_is< double >(const RDValue_cast_t)
Definition RDValue-doublemagic.h:386
RDKit::RDValue_cast_t
RDValue RDValue_cast_t
Definition RDValue-doublemagic.h:417
RDKit::rdvalue_cast< bool >
bool rdvalue_cast< bool >(RDValue_cast_t v)
Definition RDValue-doublemagic.h:473
RDKit::rdvalue_cast< float >
float rdvalue_cast< float >(RDValue_cast_t v)
Definition RDValue-doublemagic.h:446
RDKit::RDValue
Definition RDValue-doublemagic.h:166
RDKit::RDValue::RDValue
RDValue(const std::vector< int > &v)
Definition RDValue-doublemagic.h:258
RDKit::RDValue::RDValue
RDValue(const std::vector< std::string > &v)
Definition RDValue-doublemagic.h:274
RDKit::RDValue::TagMask
static const boost::uint64_t TagMask
Definition RDValue-doublemagic.h:168
RDKit::RDValue::RDValue
RDValue(const std::vector< double > &v)
Definition RDValue-doublemagic.h:242
RDKit::RDValue::RDValue
RDValue(const std::vector< unsigned int > &v)
Definition RDValue-doublemagic.h:266
RDKit::RDValue::RDValue
RDValue(double number)
Definition RDValue-doublemagic.h:180
RDKit::RDValue::RDValue
RDValue(int32_t number)
Definition RDValue-doublemagic.h:196
RDKit::RDValue::getTag
boost::uint64_t getTag() const
Definition RDValue-doublemagic.h:282
RDKit::RDValue::RDValue
RDValue(const std::any &any)
Definition RDValue-doublemagic.h:217
RDKit::RDValue::ApplyPtrMask
static const boost::uint64_t ApplyPtrMask
Definition RDValue-doublemagic.h:171
RDKit::RDValue::otherBits
boost::uint64_t otherBits
Definition RDValue-doublemagic.h:175
RDKit::RDValue::RDValue
RDValue(float number)
Definition RDValue-doublemagic.h:191
RDKit::RDValue::RDValue
RDValue(const std::string &v)
Definition RDValue-doublemagic.h:234
RDKit::RDValue::ptrCast
T * ptrCast() const
Definition RDValue-doublemagic.h:295
RDKit::RDValue::destroy
void destroy()
Definition RDValue-doublemagic.h:303
RDKit::RDValue::RDValue
RDValue(unsigned int number)
Definition RDValue-doublemagic.h:200
RDKit::RDValue::doubleBits
double doubleBits
Definition RDValue-doublemagic.h:174
RDKit::RDValue::RDValue
RDValue(const std::vector< float > &v)
Definition RDValue-doublemagic.h:250
RDKit::RDValue::RDValue
RDValue(const T &v)
Definition RDValue-doublemagic.h:227
RDKit::RDValue::cleanup_rdvalue
static void cleanup_rdvalue(RDValue v)
Definition RDValue-doublemagic.h:331
RDKit::RDValue::RDValue
RDValue()
Definition RDValue-doublemagic.h:178
RDKit::RDValue::PointerTagMask
static const boost::uint64_t PointerTagMask
Definition RDValue-doublemagic.h:169
RDKit::RDValue::RDValue
RDValue(bool number)
Definition RDValue-doublemagic.h:205
RDKit::RDValue::RDValue
RDValue(std::any *pointer)
Definition RDValue-doublemagic.h:210
RDKit::RDValue::ApplyMask
static const boost::uint64_t ApplyMask
Definition RDValue-doublemagic.h:170