4#ifndef vtkVariantInlineOperators_h
5#define vtkVariantInlineOperators_h
7#include "vtkABINamespace.h"
17VTK_ABI_NAMESPACE_BEGIN
20 return ((VariantType ==
VTK_LONG_LONG) || (VariantType == VTK_TYPE_INT64));
25#if (CHAR_MIN == SCHAR_MIN && CHAR_MAX == SCHAR_MAX)
53 return (A >= 0) && (A == UnsignedVariant.
ToTypeInt64());
62 return ((A < 0) || (
static_cast<vtkTypeUInt64
>(A) < UnsignedVariant.
ToTypeUInt64()));
71 return ((B > 0) && (UnsignedVariant.
ToTypeUInt64() <
static_cast<vtkTypeUInt64
>(B)));
94 if (!(this->Valid && other.Valid))
96 return (!(this->Valid || other.Valid));
104 (this->Data.VTKObject == other.Data.
VTKObject));
134 bool thisSigned =
IsSigned(this->Type);
135 bool otherSigned =
IsSigned(other.Type);
137 if (thisSigned ^ otherSigned)
162 if (!(this->Valid && other.Valid))
164 return ((!this->Valid) && (other.Valid));
172 (this->Data.VTKObject < other.Data.
VTKObject));
202 bool thisSigned =
IsSigned(this->Type);
203 bool otherSigned =
IsSigned(other.Type);
205 if (thisSigned ^ otherSigned)
241 return (!(this->
operator==(other) || this->
operator<(other)));
246 return (this->
operator==(other) || this->
operator<(other));
251 return (!this->
operator<(other));
A type representing the union of many types.
vtkTypeInt64 ToTypeInt64() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
double ToDouble(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkTypeUInt64 ToTypeUInt64(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
bool operator==(const vtkVariant &other) const
Compare two variants for equality, greater than, and less than.
bool operator>(const vtkVariant &other) const
Compare two variants for equality, greater than, and less than.
double ToDouble() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
bool operator<=(const vtkVariant &other) const
Compare two variants for equality, greater than, and less than.
bool operator!=(const vtkVariant &other) const
Compare two variants for equality, greater than, and less than.
float ToFloat() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkStdString ToString(int formatting=DEFAULT_FORMATTING, int precision=6) const
Convert the variant to a string.
float ToFloat(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
bool operator>=(const vtkVariant &other) const
Compare two variants for equality, greater than, and less than.
bool operator<(const vtkVariant &other) const
Compare two variants for equality, greater than, and less than.
vtkTypeInt64 ToTypeInt64(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkObjectBase * VTKObject
bool CompareSignedUnsignedLessThan(const vtkVariant &SignedVariant, const vtkVariant &UnsignedVariant)
bool CompareSignedUnsignedEqual(const vtkVariant &SignedVariant, const vtkVariant &UnsignedVariant)
bool CompareUnsignedLessThan(const vtkVariant &A, const vtkVariant &B)
bool IsFloatingPoint(int VariantType)
bool CompareSignedLessThan(const vtkVariant &A, const vtkVariant &B)
bool IsSigned(int VariantType)
bool CompareUnsignedSignedLessThan(const vtkVariant &UnsignedVariant, const vtkVariant &SignedVariant)
bool IsSigned64Bit(int VariantType)