17#include "db/database.h"
An attribute ID is used to carry attribute types (no values) around.
Definition attrid.h:20
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
Describes a column in a database table.
Definition column.h:23
const Attr::AttrId & GetAttrId() const
get attribute id
Definition column.h:77
A wrapper class to bulk-write data to the database in a simple way.
Definition writer.h:23
void SetGuid(Attr::GuidAttrId id, const Util::Guid &guid)
set guid attribute in current row
Definition writer.h:190
IndexT rowIndex
Definition writer.h:82
void SetDatabase(const Ptr< Database > &db)
set database object
Definition writer.h:90
bool isOpen
Definition writer.h:75
bool inBeginRow
Definition writer.h:76
void SetInt(Attr::IntAttrId id, int i)
set int attribute in current row
Definition writer.h:140
void Close()
close the writer - write to DB
Definition writer.cc:106
void SetBlob(Attr::BlobAttrId id, const Util::Blob &blob)
set blob attribute in current row
Definition writer.h:200
void SetMat4(Attr::Mat4AttrId id, const Math::mat4 &m)
set mat4 attribute in current row
Definition writer.h:180
virtual ~Writer()
destructor
Definition writer.cc:31
void SetBool(Attr::BoolAttrId id, bool b)
set bool attribute in current row
Definition writer.h:130
void BeginRow()
begin writing a new row
Definition writer.cc:177
IndexT FindAttrIndex(Attr::AttrId id) const
check if attribute exists in current row
void SetFlushTable(bool flushTable)
set true if the table should be deleted before writing new data
Definition writer.h:210
void EndRow()
end current row
Definition writer.cc:192
Ptr< Database > database
Definition writer.h:74
Writer()
constructor
Definition writer.cc:19
void AddColumn(const Db::Column &col)
add a column definition
Definition writer.h:110
bool flushTable
Definition writer.h:81
void SetTableName(const Util::String &n)
set the database table name
Definition writer.h:100
void SetFloat(Attr::FloatAttrId id, float f)
set float attribute in current row
Definition writer.h:150
bool Open()
open the writer
Definition writer.cc:44
void SetString(Attr::StringAttrId id, const Util::String &s)
set string attribute in current row
Definition writer.h:160
Util::Dictionary< Attr::AttrId, IndexT > columnMap
Definition writer.h:79
Ptr< ValueTable > valueTable
Definition writer.h:80
void SetVec4(Attr::Vec4AttrId id, const Math::vec4 &v)
set vec4 attribute in current row
Definition writer.h:170
bool IsOpen() const
return true if open
Definition writer.h:121
Util::Array< Column > columns
Definition writer.h:78
bool OpenFromValueTable(const Ptr< ValueTable > &values)
special case: open from existing value table
Definition writer.cc:67
Util::String tableName
Definition writer.h:77
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
The Util::Blob class encapsulates a chunk of raw memory into a C++ object which can be copied,...
Definition blob.h:22
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
bool Contains(const KEYTYPE &key) const
return true if key exists in the array
Definition dictionary.h:368
IndexT Add(const KeyValuePair< KEYTYPE, VALUETYPE > &kvp)
add a key/value pair
Definition dictionary.h:267
#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