OmniSciDB  5ade3759e0
InternalTargetValue Struct Reference

#include <TargetValue.h>

Public Types

enum  ITVType {
  ITVType::Int, ITVType::Pair, ITVType::Str, ITVType::Arr,
  ITVType::Null
}
 

Public Member Functions

 InternalTargetValue (const int64_t i1_)
 
 InternalTargetValue (const int64_t i1_, const int64_t i2_)
 
 InternalTargetValue (const std::string *s)
 
 InternalTargetValue (const std::vector< int64_t > *v)
 
 InternalTargetValue ()
 
std::string strVal () const
 
std::vector< int64_t > arrVal () const
 
bool isInt () const
 
bool isPair () const
 
bool isNull () const
 
bool isStr () const
 
bool operator< (const InternalTargetValue &other) const
 
bool operator== (const InternalTargetValue &other) const
 

Public Attributes

int64_t i1
 
int64_t i2
 
ITVType ty
 

Detailed Description

Definition at line 38 of file TargetValue.h.

Member Enumeration Documentation

◆ ITVType

Enumerator
Int 
Pair 
Str 
Arr 
Null 

Definition at line 42 of file TargetValue.h.

42 { Int, Pair, Str, Arr, Null };

Constructor & Destructor Documentation

◆ InternalTargetValue() [1/5]

InternalTargetValue::InternalTargetValue ( const int64_t  i1_)
inlineexplicit

Definition at line 46 of file TargetValue.h.

◆ InternalTargetValue() [2/5]

InternalTargetValue::InternalTargetValue ( const int64_t  i1_,
const int64_t  i2_ 
)
inlineexplicit

Definition at line 48 of file TargetValue.h.

◆ InternalTargetValue() [3/5]

InternalTargetValue::InternalTargetValue ( const std::string *  s)
inlineexplicit

Definition at line 51 of file TargetValue.h.

52  : i1(reinterpret_cast<int64_t>(s)), ty(ITVType::Str) {}

◆ InternalTargetValue() [4/5]

InternalTargetValue::InternalTargetValue ( const std::vector< int64_t > *  v)
inlineexplicit

Definition at line 54 of file TargetValue.h.

55  : i1(reinterpret_cast<int64_t>(v)), ty(ITVType::Arr) {}
T v(const TargetValue &r)

◆ InternalTargetValue() [5/5]

InternalTargetValue::InternalTargetValue ( )
inlineexplicit

Member Function Documentation

◆ arrVal()

std::vector<int64_t> InternalTargetValue::arrVal ( ) const
inline

Definition at line 61 of file TargetValue.h.

References i1.

61  {
62  return *reinterpret_cast<std::vector<int64_t>*>(i1);
63  }

◆ isInt()

bool InternalTargetValue::isInt ( ) const
inline

Definition at line 65 of file TargetValue.h.

References Int.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

◆ isNull()

bool InternalTargetValue::isNull ( ) const
inline

Definition at line 69 of file TargetValue.h.

References Null.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

◆ isPair()

bool InternalTargetValue::isPair ( ) const
inline

Definition at line 67 of file TargetValue.h.

References Pair.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

◆ isStr()

bool InternalTargetValue::isStr ( ) const
inline

Definition at line 71 of file TargetValue.h.

References Str.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

◆ operator<()

bool InternalTargetValue::operator< ( const InternalTargetValue other) const
inline

Definition at line 73 of file TargetValue.h.

References CHECK, i1, i2, Int, Null, Pair, Str, strVal(), and ty.

73  {
74  switch (ty) {
75  case ITVType::Int:
76  CHECK(other.ty == ITVType::Int);
77  return i1 < other.i1;
78  case ITVType::Pair:
79  CHECK(other.ty == ITVType::Pair);
80  if (i1 != other.i1) {
81  return i1 < other.i1;
82  }
83  return i2 < other.i2;
84  case ITVType::Str:
85  CHECK(other.ty == ITVType::Str);
86  return strVal() < other.strVal();
87  case ITVType::Null:
88  return false;
89  default:
90  abort();
91  }
92  }
std::string strVal() const
Definition: TargetValue.h:59
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:

◆ operator==()

bool InternalTargetValue::operator== ( const InternalTargetValue other) const
inline

Definition at line 94 of file TargetValue.h.

94  {
95  return !(*this < other || other < *this);
96  }

◆ strVal()

std::string InternalTargetValue::strVal ( ) const
inline

Definition at line 59 of file TargetValue.h.

References i1.

Referenced by operator<().

59 { return *reinterpret_cast<std::string*>(i1); }
+ Here is the caller graph for this function:

Member Data Documentation

◆ i1

int64_t InternalTargetValue::i1

Definition at line 39 of file TargetValue.h.

Referenced by arrVal(), ResultSet::isNull(), operator<(), and strVal().

◆ i2

int64_t InternalTargetValue::i2

Definition at line 40 of file TargetValue.h.

Referenced by ResultSet::isNull(), and operator<().

◆ ty

ITVType InternalTargetValue::ty

Definition at line 44 of file TargetValue.h.

Referenced by operator<().


The documentation for this struct was generated from the following file: