#include <SelectionMask.h>
Public Member Functions | |
SelectionMask (TableImplPtr table) | |
Constructs a SelectionMask for this specific table. | |
~SelectionMask () | |
Destructor, a noop. | |
TableImplPtr | getTable () const |
Returns the native table this SelectionMask is for. | |
void | addField (ValuePtr value) |
Adds a field restriction, the row's returned will all have the specified value. | |
void | addJoin (TableImplPtr joinTable, KeyImplPtr nativeKey, KeyImplPtr foreignKey) |
Adds a join to the specified table from the native table using the specified native and foreign keys. | |
void | addJoin (TableImplPtr nativeTable, TableImplPtr joinTable, KeyImplPtr nativeKey, KeyImplPtr foreignKey) |
Adds a join to the specified table from the specified table using the specified native and foreign keys. | |
void | addJoin (JoinPtr join) |
Adds the specified join, this join should be from a table that is either the native table or joined previously. | |
void | bindSelectMulti (sqlite3 *db, sqlite3_stmt *statement) const |
Bind the specified statement's values. | |
void | parseRow (sqlite3_stmt *statement) |
Parse a row from the statement and store it. | |
void | parseCount (sqlite3_stmt *statement) |
Parse a count from the statement and store it. | |
size_t | size () |
Returns the size of the fields restricted on. | |
Strings::const_iterator | begin () |
Returns an iterator to the first restriction fields. | |
Strings::const_iterator | end () |
Returns the 'end' iterator of the restriction fields. | |
size_t | joinssize () |
Returns the size of the joins. | |
Joins::const_iterator | joinsbegin () |
Returns an iterator to the first join. | |
Joins::const_iterator | joinsend () |
Returns the 'end' iterator of the joins. | |
SavableManagersPtr | getResult () |
Returns the result of the lookup. | |
size_t | getCount () |
Returns the row count. |
When used in conjunction with selectMulti
it allows selecting specific row's from the database from a native table. Through addJoin
additional foreign tables may be joined into the query. With addField
a restriction for that specific field may be applied. Finally the result of the query may be retreived with getResult
.
Definition at line 46 of file SelectionMask.h.
SelectionMask::SelectionMask | ( | TableImplPtr | table | ) |
Constructs a SelectionMask for this specific table.
SelectionMask::~SelectionMask | ( | ) |
Destructor, a noop.
TableImplPtr SelectionMask::getTable | ( | ) | const |
Returns the native table this SelectionMask is for.
void SelectionMask::addField | ( | ValuePtr | value | ) |
Adds a field restriction, the row's returned will all have the specified value.
void SelectionMask::addJoin | ( | TableImplPtr | joinTable, | |
KeyImplPtr | nativeKey, | |||
KeyImplPtr | foreignKey | |||
) |
Adds a join to the specified table from the native table using the specified native and foreign keys.
When creating a join from an already joined table, specify that table.
joinTable | The table to join on. | |
nativeKey | The native key to use in the join, this key should belong to the native table. | |
foreignKey | The foreign key to use in the join, this key should belong to the specified foreign table. |
void SelectionMask::addJoin | ( | TableImplPtr | nativeTable, | |
TableImplPtr | joinTable, | |||
KeyImplPtr | nativeKey, | |||
KeyImplPtr | foreignKey | |||
) |
Adds a join to the specified table from the specified table using the specified native and foreign keys.
nativeTable | The table to join from, this table should have been added with addJoin before. | |
joinTable | The table to join on. | |
nativeKey | The native key to use in the join, this key should belong to the native table. | |
foreignKey | The foreign key to use in the join, this key should belong to the specified foreign table. |
void SelectionMask::addJoin | ( | JoinPtr | join | ) |
Adds the specified join, this join should be from a table that is either the native table or joined previously.
void SelectionMask::bindSelectMulti | ( | sqlite3 * | db, | |
sqlite3_stmt * | statement | |||
) | const |
Bind the specified statement's values.
void SelectionMask::parseRow | ( | sqlite3_stmt * | statement | ) |
Parse a row from the statement and store it.
void SelectionMask::parseCount | ( | sqlite3_stmt * | statement | ) |
Parse a count from the statement and store it.
size_t SelectionMask::size | ( | ) | [inline] |
Strings::const_iterator SelectionMask::begin | ( | ) | [inline] |
Returns an iterator to the first restriction fields.
Definition at line 103 of file SelectionMask.h.
Strings::const_iterator SelectionMask::end | ( | ) | [inline] |
Returns the 'end' iterator of the restriction fields.
Definition at line 106 of file SelectionMask.h.
size_t SelectionMask::joinssize | ( | ) | [inline] |
Joins::const_iterator SelectionMask::joinsbegin | ( | ) | [inline] |
Joins::const_iterator SelectionMask::joinsend | ( | ) | [inline] |
SavableManagersPtr SelectionMask::getResult | ( | ) | [inline] |
size_t SelectionMask::getCount | ( | ) | [inline] |