SelectionMask Class Reference

This class is meant to be used to filter queries to the database. More...

#include <SelectionMask.h>

List of all members.

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.


Detailed Description

This class is meant to be used to filter queries to the database.

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.

See also:
SqliteMgr::selectMulti

addJoin

addField

getResult

Definition at line 46 of file SelectionMask.h.


Constructor & Destructor Documentation

SelectionMask::SelectionMask ( TableImplPtr  table  ) 

Constructs a SelectionMask for this specific table.

SelectionMask::~SelectionMask (  ) 

Destructor, a noop.


Member Function Documentation

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.

Parameters:
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.
See also:
addJoin

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.

Parameters:
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.
See also:
addJoin

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]

Returns the size of the fields restricted on.

Definition at line 100 of file SelectionMask.h.

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]

Returns the size of the joins.

Definition at line 110 of file SelectionMask.h.

Joins::const_iterator SelectionMask::joinsbegin (  )  [inline]

Returns an iterator to the first join.

Definition at line 113 of file SelectionMask.h.

Joins::const_iterator SelectionMask::joinsend (  )  [inline]

Returns the 'end' iterator of the joins.

Definition at line 116 of file SelectionMask.h.

SavableManagersPtr SelectionMask::getResult (  )  [inline]

Returns the result of the lookup.

Definition at line 120 of file SelectionMask.h.

size_t SelectionMask::getCount (  )  [inline]

Returns the row count.

Definition at line 123 of file SelectionMask.h.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo