OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EmbeddedDatabase::CursorImpl Class Reference
+ Inheritance diagram for EmbeddedDatabase::CursorImpl:
+ Collaboration diagram for EmbeddedDatabase::CursorImpl:

Public Member Functions

 CursorImpl (std::shared_ptr< ResultSet > result_set, std::shared_ptr< Data_Namespace::DataMgr > data_mgr)
 
size_t getColCount ()
 
size_t getRowCount ()
 
Row getNextRow ()
 
ColumnType getColType (uint32_t col_num)
 
- Public Member Functions inherited from EmbeddedDatabase::Cursor
size_t getColCount ()
 
size_t getRowCount ()
 
Row getNextRow ()
 
int getColType (uint32_t col_num)
 

Private Attributes

std::shared_ptr< ResultSetresult_set_
 
std::weak_ptr
< Data_Namespace::DataMgr
data_mgr_
 

Detailed Description

Cursor internal implementation

Definition at line 35 of file DBEngine.cpp.

Constructor & Destructor Documentation

EmbeddedDatabase::CursorImpl::CursorImpl ( std::shared_ptr< ResultSet result_set,
std::shared_ptr< Data_Namespace::DataMgr data_mgr 
)
inline

Definition at line 37 of file DBEngine.cpp.

39  : result_set_(result_set), data_mgr_(data_mgr) {}
std::shared_ptr< ResultSet > result_set_
Definition: DBEngine.cpp:84
std::weak_ptr< Data_Namespace::DataMgr > data_mgr_
Definition: DBEngine.cpp:85

Member Function Documentation

size_t EmbeddedDatabase::CursorImpl::getColCount ( )
inline

Definition at line 41 of file DBEngine.cpp.

References result_set_.

Referenced by EmbeddedDatabase::Cursor::getColCount(), and getColType().

41 { return result_set_->colCount(); }
std::shared_ptr< ResultSet > result_set_
Definition: DBEngine.cpp:84

+ Here is the caller graph for this function:

ColumnType EmbeddedDatabase::CursorImpl::getColType ( uint32_t  col_num)
inline

Definition at line 53 of file DBEngine.cpp.

References EmbeddedDatabase::Double, EmbeddedDatabase::Float, SQLTypeInfo::get_type(), getColCount(), EmbeddedDatabase::Integer, kBIGINT, kCHAR, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTINYINT, kVARCHAR, result_set_, EmbeddedDatabase::String, and EmbeddedDatabase::Unknown.

Referenced by EmbeddedDatabase::Cursor::getColType().

53  {
54  if (col_num < getColCount()) {
55  SQLTypeInfo type_info = result_set_->getColType(col_num);
56  switch (type_info.get_type()) {
57  case kNUMERIC:
58  case kDECIMAL:
59  case kINT:
60  case kSMALLINT:
61  case kBIGINT:
62  case kTINYINT:
63  return ColumnType::Integer;
64 
65  case kDOUBLE:
66  return ColumnType::Double;
67 
68  case kFLOAT:
69  return ColumnType::Float;
70 
71  case kCHAR:
72  case kVARCHAR:
73  case kTEXT:
74  return ColumnType::String;
75 
76  default:
77  return ColumnType::Unknown;
78  }
79  }
80  return ColumnType::Unknown;
81  }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:259
std::shared_ptr< ResultSet > result_set_
Definition: DBEngine.cpp:84
Definition: sqltypes.h:54
Definition: sqltypes.h:43
Definition: sqltypes.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Row EmbeddedDatabase::CursorImpl::getNextRow ( )
inline

Definition at line 45 of file DBEngine.cpp.

References result_set_.

Referenced by EmbeddedDatabase::Cursor::getNextRow().

45  {
46  auto row = result_set_->getNextRow(true, false);
47  if (row.empty()) {
48  return Row();
49  }
50  return Row(row);
51  }
std::shared_ptr< ResultSet > result_set_
Definition: DBEngine.cpp:84

+ Here is the caller graph for this function:

size_t EmbeddedDatabase::CursorImpl::getRowCount ( )
inline

Definition at line 43 of file DBEngine.cpp.

References result_set_.

Referenced by EmbeddedDatabase::Cursor::getRowCount().

43 { return result_set_->rowCount(); }
std::shared_ptr< ResultSet > result_set_
Definition: DBEngine.cpp:84

+ Here is the caller graph for this function:

Member Data Documentation

std::weak_ptr<Data_Namespace::DataMgr> EmbeddedDatabase::CursorImpl::data_mgr_
private

Definition at line 85 of file DBEngine.cpp.

std::shared_ptr<ResultSet> EmbeddedDatabase::CursorImpl::result_set_
private

Definition at line 84 of file DBEngine.cpp.

Referenced by getColCount(), getColType(), getNextRow(), and getRowCount().


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