OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{DBETypes.cpp} Namespace Reference

Functions

void checkColumnRange (size_t index, size_t count)
 
template<typename T >
void getFieldValue (T &result, TargetValue *field)
 

Function Documentation

void anonymous_namespace{DBETypes.cpp}::checkColumnRange ( size_t  index,
size_t  count 
)

Definition at line 20 of file DBETypes.cpp.

References to_string().

Referenced by EmbeddedDatabase::Row::getDouble(), EmbeddedDatabase::Row::getFloat(), EmbeddedDatabase::Row::getInt(), and EmbeddedDatabase::Row::getStr().

20  {
21  if (index >= count) {
22  throw std::out_of_range("Column index " + std::to_string(index) +
23  " is out of range: 0.." + std::to_string(count - 1));
24  }
25 }
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void anonymous_namespace{DBETypes.cpp}::getFieldValue ( T &  result,
TargetValue field 
)

Definition at line 28 of file DBETypes.cpp.

References field(), and heavydb.dtypes::T.

Referenced by EmbeddedDatabase::Row::getDouble(), EmbeddedDatabase::Row::getFloat(), EmbeddedDatabase::Row::getInt(), and com.mapd.calcite.parser.HeavyDBTable::getRowType().

28  {
29  ScalarTargetValue* scalar_value = boost::get<ScalarTargetValue>(field);
30  if (!scalar_value) {
31  throw std::runtime_error("Unsupported field type");
32  }
33  T* result_ptr = boost::get<T>(scalar_value);
34  if (!result_ptr) {
35  throw std::runtime_error("Null field");
36  }
37  result = *result_ptr;
38 }
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:33
boost::variant< int64_t, double, float, NullableString > ScalarTargetValue
Definition: TargetValue.h:180

+ Here is the call graph for this function:

+ Here is the caller graph for this function: