#include <trdb.h>
Public Attributes | |
bt_compare_func_t | bt_compare_func |
associate_func_t | associate_func |
QString | name |
Db * | db |
read: http://www.sleepycat.com/docs/api_cxx/db_associate.html
http://www.sleepycat.com/docs/api_cxx/db_set_bt_compare.html
Right now only in FeatureData and in ReadData is indexing done. Right now the serializing there is done with structs. But if we want to index in both in a class and also in its child classes we should probably use an associate() function where we don't unserialize with a struct but instead use the GeneralData::readStream(). For pulling out an integer value from a GeneralData we do something like (note the DB_DBT_APPMALLOC flag):
int SubClassOfGeneralData::associateFunc( Db * dbp , const Dbt * , const Dbt *pdata, Dbt *skey)
{
memset(skey, 0, sizeof(Dbt));
SubClassOfGeneralData d;
Database::setFromDbt( pdata, &d )
int answer = d.getInterestingValue();
int * allocatedInt = malloc(sizeof( int ));
allocatedInt = answer;
skey->set_data( ( u_int8_t * ) allocatedInt;
skey->set_size(sizeof( int ));
skey->set_flags( DB_DBT_APPMALLOC );
return 0; }
Definition at line 77 of file trdb.h.
|
http://www.sleepycat.com/docs/api_cxx/db_set_bt_compare.html Definition at line 80 of file trdb.h. Referenced by Database::SecondaryIterator< T >::fillSecondaryDataDbt(). |
|
|
|
lookup string Definition at line 82 of file trdb.h. Referenced by Database::SecondaryIterator< T >::delCurrentInclDups(), Database::SecondaryIterator< T >::fillSecondaryDataDbt(), Database::SecondaryIterator< T >::pget(), and Database::SecondaryIterator< T >::SecondaryIterator(). |
|
http://www.sleepycat.com/docs/api_cxx/db_associate.html Definition at line 81 of file trdb.h. Referenced by ReadData::getIndexMap(), FeatureData::getIndexMap(), and hookBeforeCreate(). |