|
|
|
Home / Open source / Terimber 2.0
memindex Class Referenceimplementation of terimber_memindex interface
More...
#include <memdb.h>
List of all members.
|
Public Member Functions |
virtual terimber_memlookup * | add_lookup (const terimber_db_value_vector *info) |
| for navigation the user has to create index lookup first the list of values should be the same length & type as the index columns or less for example, let us assume that we got the index with two columns (id, integer) & (name, string) if the user provides values for id & name then the lookup will search for rows with specified id & name however, if only id is specified, lookup will ignore the second column values. it's impossible to set search lookup on the second column without setting the first column to do such a thing the user needs to create index with a different order of index columns, for instance name and id, and set search criteria for the name column. user is allowed to ignore search criteria completely, then lookup will move row by row in the order they came from the database, including the row with status = deleted
|
virtual bool | remove_lookup (terimber_memlookup *obj) |
| destroys lookup after using
|
const memtable & | get_table () const |
| returns const memtable
|
memtable & | get_table () |
| returns memtable
|
const memdb_index_t & | get_index () |
| returns index table
|
Protected Member Functions |
| memindex (memtable &parent, const memdb_rowset_less &pred) |
| constructor
|
virtual | ~memindex () |
| destructor users can't call destructor, memtable will take case about cleanup
|
Private Types |
typedef list< memlookup * > | list_lookups_t |
| list of lookups
|
Private Member Functions |
bool | construct () |
| constructs index
|
void | notify (memdb_rowset_citerator_t iter, bool insert_or_delete) |
| notifies all lookup about changes
|
Private Attributes |
memtable & | _parent |
| parent memtable
|
memdb_index_t | _index |
| index table
|
mutex | _mtx |
| mutex
|
list_lookups_t | _lookups |
| list of lookups
|
Friends |
class | memtable |
| memtable
|
Detailed Description
implementation of terimber_memindex interface
Definition at line 647 of file memdb.h.
Member Typedef Documentation
Constructor & Destructor Documentation
constructor
- Parameters:
-
parent |
parent memtable |
pred |
predicate for row copmparision |
Definition at line 38 of file memindex.cpp.
memindex::~memindex |
( |
|
) |
[protected, virtual] |
Member Function Documentation
for navigation the user has to create index lookup first the list of values should be the same length & type as the index columns or less for example, let us assume that we got the index with two columns (id, integer) & (name, string) if the user provides values for id & name then the lookup will search for rows with specified id & name however, if only id is specified, lookup will ignore the second column values. it's impossible to set search lookup on the second column without setting the first column to do such a thing the user needs to create index with a different order of index columns, for instance name and id, and set search criteria for the name column. user is allowed to ignore search criteria completely, then lookup will move row by row in the order they came from the database, including the row with status = deleted
- Parameters:
-
Implements terimber_memindex.
Definition at line 64 of file memindex.cpp.
References _lookups, _mtx, memlookup::construct(), terimber_log_helper::log_on(), and list< T >::push_back().
const memtable& memindex::get_table |
( |
|
) |
const [inline] |
memtable& memindex::get_table |
( |
|
) |
[inline] |
bool memindex::construct |
( |
|
) |
[private] |
notifies all lookup about changes
- Parameters:
-
iter |
affected row iterator |
insert_or_delete |
deleted or not |
Definition at line 108 of file memindex.cpp.
References _index, _lookups, _mtx, base_list< T >::begin(), base_map< K, T, Pr, M >::end(), base_list< T >::end(), base_map< K, T, Pr, M >::equal_range(), map< K, T, Pr, M >::erase(), pair< T1, T2 >::first, map< K, T, Pr, M >::insert(), and pair< T1, T2 >::second.
Friends And Related Function Documentation
Member Data Documentation
The documentation for this class was generated from the following files:
|
|
|
|