10#include <boost/any.hpp>
11#include <boost/version.hpp>
19 template <
typename TYPE>
20 static TYPE
get(
const boost::any& var) {
21 return var.type() ==
typeid(TYPE) ? boost::any_cast<TYPE>(var) : TYPE();
24 template <
typename TYPE,
typename VAR>
25 static TYPE
get(VAR var) {
26#if BOOST_VERSION < 105800
27 return var.type() ==
typeid(TYPE) ? boost::get<TYPE>(var) : TYPE();
29 return var.type() ==
typeid(TYPE) ? boost::relaxed_get<TYPE>(var) : TYPE();
33 template <
typename TYPE,
typename VAR>
35 return (var.type() ==
typeid(TYPE));
38 static VariantNull
null() {
42 static bool isNull(
const boost::any& var) {
46 template <
typename VAR>
51 template <
typename VAR>
64 return (int32_t)(longBits ^ (longBits >> 32));
87 template <
typename FIRST,
typename SECOND>
89 return (first.type() == second.type());
92 template <
typename FIRST,
typename SECOND>
93 static bool equals(FIRST first, SECOND second) {
94 return first.type() == second.type() ? (first == second) :
false;
97 template <
typename VAR>
99 return first < second ? -1 : (first == second ? 0 : 1);
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
static int64_t doubleToLongBits(double value)
Returns a representation of the specified floating-point value according to the IEEE 754 floating-poi...
static int32_t hashCode(const String &value)
Compute the hash code from string.
Definition VariantUtils.h:17
static TYPE get(const boost::any &var)
Definition VariantUtils.h:20
static int32_t hashCode(VAR var)
Definition VariantUtils.h:52
static bool isNull(VAR var)
Definition VariantUtils.h:47
static bool typeOf(VAR var)
Definition VariantUtils.h:34
static bool isNull(const boost::any &var)
Definition VariantUtils.h:42
static bool equalsType(FIRST first, SECOND second)
Definition VariantUtils.h:88
static int32_t compareTo(VAR first, VAR second)
Definition VariantUtils.h:98
static TYPE get(VAR var)
Definition VariantUtils.h:25
static VariantNull null()
Definition VariantUtils.h:38
static bool equals(FIRST first, SECOND second)
Definition VariantUtils.h:93
Definition AbstractAllTermDocs.h:12