OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EmbeddedDatabase::Row Class Reference

#include <DBETypes.h>

Public Member Functions

 Row ()
 
 Row (std::vector< TargetValue > &row)
 
int64_t getInt (size_t col_num)
 
float getFloat (size_t col_num)
 
double getDouble (size_t col_num)
 
std::string getStr (size_t col_num)
 

Private Attributes

std::vector< TargetValuerow_
 

Detailed Description

Definition at line 82 of file DBETypes.h.

Constructor & Destructor Documentation

EmbeddedDatabase::Row::Row ( )

Row methods

Definition at line 73 of file DBETypes.cpp.

73 {}
EmbeddedDatabase::Row::Row ( std::vector< TargetValue > &  row)

Definition at line 75 of file DBETypes.cpp.

75 : row_(std::move(row)) {}
std::vector< TargetValue > row_
Definition: DBETypes.h:92

Member Function Documentation

double EmbeddedDatabase::Row::getDouble ( size_t  col_num)

Definition at line 91 of file DBETypes.cpp.

References anonymous_namespace{DBETypes.cpp}::checkColumnRange(), anonymous_namespace{DBETypes.cpp}::getFieldValue(), and row_.

91  {
92  double value;
93  checkColumnRange(col_num, row_.size());
94  getFieldValue(value, &row_[col_num]);
95  return value;
96 }
void checkColumnRange(size_t index, size_t count)
Definition: DBETypes.cpp:20
void getFieldValue(T &result, TargetValue *field)
Definition: DBETypes.cpp:28
std::vector< TargetValue > row_
Definition: DBETypes.h:92

+ Here is the call graph for this function:

float EmbeddedDatabase::Row::getFloat ( size_t  col_num)

Definition at line 84 of file DBETypes.cpp.

References anonymous_namespace{DBETypes.cpp}::checkColumnRange(), anonymous_namespace{DBETypes.cpp}::getFieldValue(), and row_.

84  {
85  float value;
86  checkColumnRange(col_num, row_.size());
87  getFieldValue(value, &row_[col_num]);
88  return value;
89 }
void checkColumnRange(size_t index, size_t count)
Definition: DBETypes.cpp:20
void getFieldValue(T &result, TargetValue *field)
Definition: DBETypes.cpp:28
std::vector< TargetValue > row_
Definition: DBETypes.h:92

+ Here is the call graph for this function:

int64_t EmbeddedDatabase::Row::getInt ( size_t  col_num)

Definition at line 77 of file DBETypes.cpp.

References anonymous_namespace{DBETypes.cpp}::checkColumnRange(), anonymous_namespace{DBETypes.cpp}::getFieldValue(), and row_.

77  {
78  int64_t value;
79  checkColumnRange(col_num, row_.size());
80  getFieldValue(value, &row_[col_num]);
81  return value;
82 }
void checkColumnRange(size_t index, size_t count)
Definition: DBETypes.cpp:20
void getFieldValue(T &result, TargetValue *field)
Definition: DBETypes.cpp:28
std::vector< TargetValue > row_
Definition: DBETypes.h:92

+ Here is the call graph for this function:

std::string EmbeddedDatabase::Row::getStr ( size_t  col_num)

Definition at line 98 of file DBETypes.cpp.

References anonymous_namespace{DBETypes.cpp}::checkColumnRange(), and row_.

98  {
99  checkColumnRange(col_num, row_.size());
100  const auto scalar_value = boost::get<ScalarTargetValue>(&row_[col_num]);
101  auto value = boost::get<NullableString>(scalar_value);
102  if (!value || boost::get<void*>(value)) {
103  return "";
104  }
105  if (auto str = boost::get<std::string>(value)) {
106  return *str;
107  }
108  return "";
109 }
void checkColumnRange(size_t index, size_t count)
Definition: DBETypes.cpp:20
std::vector< TargetValue > row_
Definition: DBETypes.h:92

+ Here is the call graph for this function:

Member Data Documentation

std::vector<TargetValue> EmbeddedDatabase::Row::row_
private

Definition at line 92 of file DBETypes.h.

Referenced by getDouble(), getFloat(), getInt(), and getStr().


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