OmniSciDB  c07336695a
FixedWidthSmallDate Class Reference

#include <Codec.h>

+ Inheritance diagram for FixedWidthSmallDate:
+ Collaboration diagram for FixedWidthSmallDate:

Public Member Functions

 FixedWidthSmallDate (const size_t byte_width)
 
llvm::Instruction * codegenDecode (llvm::Value *byte_stream, llvm::Value *pos, llvm::Module *module) const override
 
- Public Member Functions inherited from Decoder
virtual ~Decoder ()
 

Private Attributes

const size_t byte_width_
 
const int32_t null_val_
 

Static Private Attributes

static constexpr int64_t ret_null_val_ = NULL_BIGINT
 

Detailed Description

Definition at line 79 of file Codec.h.

Constructor & Destructor Documentation

◆ FixedWidthSmallDate()

FixedWidthSmallDate::FixedWidthSmallDate ( const size_t  byte_width)

Definition at line 86 of file Codec.cpp.

References NULL_INT, NULL_SMALLINT, and null_val_.

87  : byte_width_{byte_width}, null_val_{byte_width == 4 ? NULL_INT : NULL_SMALLINT} {}
const int32_t null_val_
Definition: Codec.h:88
#define NULL_INT
Definition: sqltypes.h:174
#define NULL_SMALLINT
Definition: sqltypes.h:173
const size_t byte_width_
Definition: Codec.h:87

Member Function Documentation

◆ codegenDecode()

llvm::Instruction * FixedWidthSmallDate::codegenDecode ( llvm::Value *  byte_stream,
llvm::Value *  pos,
llvm::Module *  module 
) const
overridevirtual

Implements Decoder.

Definition at line 89 of file Codec.cpp.

References run-benchmark-import::args, byte_width_, CHECK, getGlobalLLVMContext(), null_val_, and ret_null_val_.

91  {
92  auto& context = getGlobalLLVMContext();
93  auto f = module->getFunction("fixed_width_small_date_decode");
94  CHECK(f);
95  llvm::Value* args[] = {
96  byte_stream,
97  llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), byte_width_),
98  llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), null_val_),
99  llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), ret_null_val_),
100  pos};
101  return llvm::CallInst::Create(f, args);
102 }
const int32_t null_val_
Definition: Codec.h:88
static constexpr int64_t ret_null_val_
Definition: Codec.h:89
llvm::LLVMContext & getGlobalLLVMContext()
#define CHECK(condition)
Definition: Logger.h:187
const size_t byte_width_
Definition: Codec.h:87
+ Here is the call graph for this function:

Member Data Documentation

◆ byte_width_

const size_t FixedWidthSmallDate::byte_width_
private

Definition at line 87 of file Codec.h.

Referenced by codegenDecode().

◆ null_val_

const int32_t FixedWidthSmallDate::null_val_
private

Definition at line 88 of file Codec.h.

Referenced by codegenDecode(), and FixedWidthSmallDate().

◆ ret_null_val_

constexpr int64_t FixedWidthSmallDate::ret_null_val_ = NULL_BIGINT
staticprivate

Definition at line 89 of file Codec.h.

Referenced by codegenDecode().


The documentation for this class was generated from the following files: