15#include "db/dataset.h"
19#include "db/database.h"
141 return this->
dataset->Values()->GetNumRows();
An attribute ID is used to carry attribute types (no values) around.
Definition attrid.h:20
A compiletime-typesafe key/value pair.
Definition attribute.h:32
Typed attribute id for blob type.
Definition blobattrid.h:18
Typed attribute id for bool type.
Definition boolattrid.h:18
Typed attribute id for float type.
Definition floatattrid.h:18
Typed attribute id for guid type.
Definition guidattrid.h:18
Typed attribute id for integer type.
Definition intattrid.h:18
Typed attribute id for mat4 type.
Definition mat4attrid.h:18
Typed attribute id for string type.
Definition stringattrid.h:18
Typed attribute id for vec4 type.
Definition vec4attrid.h:18
The common base class of Nebula.
Definition refcounted.h:38
Wrapper to bulk-read the contents of a database table.
Definition reader.h:25
virtual ~Reader()
destructor
Definition reader.cc:27
const Math::mat4 GetMat4(Attr::Mat4AttrId attrId) const
return mat4 attribute value
Definition reader.cc:158
bool isOpen
Definition reader.h:76
const Util::Blob & GetBlob(Attr::BlobAttrId attrId) const
return blob attribute value
Definition reader.cc:178
int GetNumRows() const
get number of rows in the result
Definition reader.h:138
Reader()
constructor
Definition reader.cc:17
Ptr< Database > database
Definition reader.h:77
Util::Array< Attr::Attribute > filterAttrs
Definition reader.h:79
const Math::vec4 GetVec4(Attr::Vec4AttrId attrId) const
return vec4 attribute value
Definition reader.cc:148
void SetTableName(const Util::String &n)
set the database table name
Definition reader.h:117
bool HasAttr(Attr::AttrId attrId) const
return true if attribute exists at current row
Definition reader.cc:98
Ptr< ValueTable > valueTable
Definition reader.h:81
bool Open()
open the reader, this will perform a query on the database
Definition reader.cc:41
void Close()
close the reader
Definition reader.cc:84
const Util::Guid & GetGuid(Attr::GuidAttrId attrId) const
return guid attribute value
Definition reader.cc:168
const Ptr< Db::ValueTable > & GetValueTable() const
get direct pointer to value table
Definition reader.h:107
IndexT curRowIndex
Definition reader.h:82
Util::String tableName
Definition reader.h:78
const Util::String & GetString(Attr::StringAttrId attrId) const
return string attribute value
Definition reader.cc:138
void SetToRow(int rowIndex)
set read cursor to specified row
Definition reader.h:149
void SetDatabase(const Ptr< Database > &db)
set database object
Definition reader.h:89
int GetInt(Attr::IntAttrId attrId) const
return int attribute value
Definition reader.cc:118
bool IsOpen() const
return true if reader is open
Definition reader.h:98
bool GetBool(Attr::BoolAttrId attrId) const
return bool attribute value
Definition reader.cc:108
int GetCurrentRowIndex() const
get current row index
Definition reader.h:160
void AddFilterAttr(const Attr::Attribute &attr)
add an optional filter/WHERE attribute
Definition reader.h:128
float GetFloat(Attr::FloatAttrId attrId) const
return float attribute value
Definition reader.cc:128
Ptr< Dataset > dataset
Definition reader.h:80
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
void Append(const TYPE &first, const ELEM_TYPE &... elements)
Append multiple elements to the end of the array.
Definition array.h:1334
The Util::Blob class encapsulates a chunk of raw memory into a C++ object which can be copied,...
Definition blob.h:22
#define n_assert(exp)
Definition debug.h:50
A 4x4 single point precision float matrix.
Definition mat4.h:49
A 4D vector.
Definition vec4.h:24
Nebula's universal string class.
Definition string.h:50
int IndexT
Definition types.h:48