OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 36 of file TargetValue.h.

Member Enumeration Documentation

Enumerator
Int 
Pair 
Str 
Arr 
Null 

Definition at line 40 of file TargetValue.h.

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

Constructor & Destructor Documentation

InternalTargetValue::InternalTargetValue ( const int64_t  i1_)
inlineexplicit

Definition at line 44 of file TargetValue.h.

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

Definition at line 46 of file TargetValue.h.

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

Definition at line 49 of file TargetValue.h.

50  : i1(reinterpret_cast<int64_t>(s)), ty(ITVType::Str) {}
InternalTargetValue::InternalTargetValue ( const std::vector< int64_t > *  v)
inlineexplicit

Definition at line 52 of file TargetValue.h.

53  : i1(reinterpret_cast<int64_t>(v)), ty(ITVType::Arr) {}
InternalTargetValue::InternalTargetValue ( )
inlineexplicit

Definition at line 55 of file TargetValue.h.

References Null.

Member Function Documentation

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

Definition at line 59 of file TargetValue.h.

References i1.

59  {
60  return *reinterpret_cast<std::vector<int64_t>*>(i1);
61  }
bool InternalTargetValue::isInt ( ) const
inline

Definition at line 63 of file TargetValue.h.

References Int, and ty.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

bool InternalTargetValue::isNull ( ) const
inline

Definition at line 67 of file TargetValue.h.

References Null, and ty.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

bool InternalTargetValue::isPair ( ) const
inline

Definition at line 65 of file TargetValue.h.

References Pair, and ty.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

bool InternalTargetValue::isStr ( ) const
inline

Definition at line 69 of file TargetValue.h.

References Str, and ty.

Referenced by ResultSet::isNull().

+ Here is the caller graph for this function:

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

Definition at line 71 of file TargetValue.h.

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

71  {
72  switch (ty) {
73  case ITVType::Int:
74  CHECK(other.ty == ITVType::Int);
75  return i1 < other.i1;
76  case ITVType::Pair:
77  CHECK(other.ty == ITVType::Pair);
78  if (i1 != other.i1) {
79  return i1 < other.i1;
80  }
81  return i2 < other.i2;
82  case ITVType::Str:
83  CHECK(other.ty == ITVType::Str);
84  return strVal() < other.strVal();
85  case ITVType::Null:
86  return false;
87  default:
88  abort();
89  }
90  }
std::string strVal() const
Definition: TargetValue.h:57
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

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

Definition at line 92 of file TargetValue.h.

92  {
93  return !(*this < other || other < *this);
94  }
std::string InternalTargetValue::strVal ( ) const
inline

Definition at line 57 of file TargetValue.h.

References i1.

Referenced by operator<().

57 { return *reinterpret_cast<std::string*>(i1); }

+ Here is the caller graph for this function:

Member Data Documentation

int64_t InternalTargetValue::i1

Definition at line 37 of file TargetValue.h.

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

int64_t InternalTargetValue::i2

Definition at line 38 of file TargetValue.h.

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

ITVType InternalTargetValue::ty

Definition at line 42 of file TargetValue.h.

Referenced by isInt(), isNull(), isPair(), isStr(), and operator<().


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