![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
#include <BombayTableIndex.hpp>
Inheritance diagram for cat::bombay::TableIndex:Public Member Functions | |
| CAT_INLINE u64 | Complete (const void *data) |
| CAT_INLINE u64 | Field (const void *data) |
| CAT_INLINE const char * | GetFilePath () |
| bool | Initialize () |
| void | Insert (u64 hash, u64 offset) |
| CAT_INLINE void | InsertComplete (const void *data, u64 offset) |
| CAT_INLINE void | InsertField (const void *data, u64 offset) |
| CAT_INLINE void | InsertVarField (const void *data, u32 bytes, u64 offset) |
| u64 | Lookup (u64 hash) |
| CAT_INLINE u64 | LookupComplete (const void *data) |
| CAT_INLINE u64 | LookupField (const void *data) |
| CAT_INLINE u64 | LookupVarField (const void *data, u32 bytes) |
| void | Remove (u64 hash) |
| CAT_INLINE void | RemoveComplete (const void *data) |
| CAT_INLINE void | RemoveField (const void *data) |
| CAT_INLINE void | RemoveVarField (const void *data, u32 bytes) |
| TableIndex (Table *parent, const char *index_file_path, IHash *hash_function, ShutdownObserver *shutdown_observer) | |
| CAT_INLINE u64 | VarField (const void *data, u32 bytes) |
| ~TableIndex () | |
Protected Member Functions | |
| bool | AllocateTable () |
| bool | DoubleTable () |
| void | FreeTable () |
| virtual bool | OnRead (ThreadPoolLocalStorage *tls, int error, AsyncBuffer *buffer, u32 bytes) |
| void | Save () |
Protected Attributes | |
| char | _file_path [MAX_PATH+1] |
| RWLock | _lock |
| u64 * | _table |
| u32 | _table_elements |
| u32 | _table_raw_bytes |
| u32 | _used_elements |
Static Protected Attributes | |
| static const u64 | COLLIDE_MASK = ~OFFSET_MASK |
| static const u32 | COLLISION_INCREMENTER = 1017234223 |
| static const u32 | COLLISION_MULTIPLIER = 71*7487 * 4 + 1 |
| static const u32 | MIN_ELEMENTS = 1024 |
| static const u64 | OFFSET_MASK = (~(u64)0) >> 1 |
| static const u64 | TABLE_CHECK_HASH_SALT = 0x74B1301234DEADBE |
| static const u32 | TABLE_FOOTER_BYTES = 16 |
Private Attributes | |
| IHash * | _index_hash |
| TableIndex * | _next |
| TableIndex * | _next_loading |
| TableIndex * | _next_unique |
| Table * | _parent |
| ShutdownObserver * | _shutdown_observer |
Friends | |
| class | Table |
Definition at line 111 of file BombayTableIndex.hpp.
| cat::bombay::TableIndex::TableIndex | ( | Table * | parent, |
| const char * | index_file_path, | ||
| IHash * | hash_function, | ||
| ShutdownObserver * | shutdown_observer | ||
| ) |
| cat::bombay::TableIndex::~TableIndex | ( | ) |
| bool cat::bombay::TableIndex::AllocateTable | ( | ) | [protected] |
| CAT_INLINE u64 cat::bombay::TableIndex::Complete | ( | const void * | data | ) | [inline] |
Definition at line 172 of file BombayTableIndex.hpp.
References _index_hash, and cat::bombay::IHash::HashComplete().
{
return _index_hash->HashComplete(data);
}
| bool cat::bombay::TableIndex::DoubleTable | ( | ) | [protected] |
| CAT_INLINE u64 cat::bombay::TableIndex::Field | ( | const void * | data | ) | [inline] |
Definition at line 168 of file BombayTableIndex.hpp.
References _index_hash, and cat::bombay::IHash::HashField().
{
return _index_hash->HashField(data);
}
| void cat::bombay::TableIndex::FreeTable | ( | ) | [protected] |
| CAT_INLINE const char* cat::bombay::TableIndex::GetFilePath | ( | ) | [inline] |
Reimplemented from cat::AsyncFile.
Definition at line 161 of file BombayTableIndex.hpp.
References _file_path.
{ return _file_path; }
| bool cat::bombay::TableIndex::Initialize | ( | ) |
Referenced by InsertComplete(), InsertField(), and InsertVarField().
| CAT_INLINE void cat::bombay::TableIndex::InsertComplete | ( | const void * | data, |
| u64 | offset | ||
| ) | [inline] |
Definition at line 206 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashComplete(), and Insert().
{
Insert(_index_hash->HashComplete(data), offset);
}
| CAT_INLINE void cat::bombay::TableIndex::InsertField | ( | const void * | data, |
| u64 | offset | ||
| ) | [inline] |
Definition at line 202 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashField(), and Insert().
{
Insert(_index_hash->HashField(data), offset);
}
| CAT_INLINE void cat::bombay::TableIndex::InsertVarField | ( | const void * | data, |
| u32 | bytes, | ||
| u64 | offset | ||
| ) | [inline] |
Definition at line 198 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashVarField(), and Insert().
{
Insert(_index_hash->HashVarField(data, bytes), offset);
}
Referenced by LookupComplete(), LookupField(), and LookupVarField().
| CAT_INLINE u64 cat::bombay::TableIndex::LookupComplete | ( | const void * | data | ) | [inline] |
Definition at line 192 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashComplete(), and Lookup().
{
return Lookup(_index_hash->HashComplete(data));
}
| CAT_INLINE u64 cat::bombay::TableIndex::LookupField | ( | const void * | data | ) | [inline] |
Definition at line 188 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashField(), and Lookup().
{
return Lookup(_index_hash->HashField(data));
}
Definition at line 184 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashVarField(), and Lookup().
{
return Lookup(_index_hash->HashVarField(data, bytes));
}
| virtual bool cat::bombay::TableIndex::OnRead | ( | ThreadPoolLocalStorage * | tls, |
| int | error, | ||
| AsyncBuffer * | buffer, | ||
| u32 | bytes | ||
| ) | [protected, virtual] |
| void cat::bombay::TableIndex::Remove | ( | u64 | hash | ) |
Referenced by RemoveComplete(), RemoveField(), and RemoveVarField().
| CAT_INLINE void cat::bombay::TableIndex::RemoveComplete | ( | const void * | data | ) | [inline] |
Definition at line 220 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashComplete(), and Remove().
{
Remove(_index_hash->HashComplete(data));
}
| CAT_INLINE void cat::bombay::TableIndex::RemoveField | ( | const void * | data | ) | [inline] |
Definition at line 216 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashField(), and Remove().
{
Remove(_index_hash->HashField(data));
}
| CAT_INLINE void cat::bombay::TableIndex::RemoveVarField | ( | const void * | data, |
| u32 | bytes | ||
| ) | [inline] |
Definition at line 212 of file BombayTableIndex.hpp.
References _index_hash, cat::bombay::IHash::HashVarField(), and Remove().
{
Remove(_index_hash->HashVarField(data, bytes));
}
| void cat::bombay::TableIndex::Save | ( | ) | [protected] |
Definition at line 164 of file BombayTableIndex.hpp.
References _index_hash, and cat::bombay::IHash::HashVarField().
{
return _index_hash->HashVarField(data, bytes);
}
friend class Table [friend] |
Definition at line 113 of file BombayTableIndex.hpp.
char cat::bombay::TableIndex::_file_path[MAX_PATH+1] [protected] |
Reimplemented from cat::AsyncFile.
Definition at line 141 of file BombayTableIndex.hpp.
Referenced by GetFilePath().
IHash* cat::bombay::TableIndex::_index_hash [private] |
Definition at line 117 of file BombayTableIndex.hpp.
Referenced by Complete(), Field(), InsertComplete(), InsertField(), InsertVarField(), LookupComplete(), LookupField(), LookupVarField(), RemoveComplete(), RemoveField(), RemoveVarField(), and VarField().
RWLock cat::bombay::TableIndex::_lock [protected] |
Definition at line 134 of file BombayTableIndex.hpp.
TableIndex* cat::bombay::TableIndex::_next [private] |
Definition at line 118 of file BombayTableIndex.hpp.
TableIndex * cat::bombay::TableIndex::_next_loading [private] |
Definition at line 118 of file BombayTableIndex.hpp.
TableIndex * cat::bombay::TableIndex::_next_unique [private] |
Definition at line 118 of file BombayTableIndex.hpp.
Table* cat::bombay::TableIndex::_parent [private] |
Definition at line 116 of file BombayTableIndex.hpp.
Definition at line 115 of file BombayTableIndex.hpp.
u64* cat::bombay::TableIndex::_table [protected] |
Definition at line 136 of file BombayTableIndex.hpp.
u32 cat::bombay::TableIndex::_table_elements [protected] |
Definition at line 138 of file BombayTableIndex.hpp.
u32 cat::bombay::TableIndex::_table_raw_bytes [protected] |
Definition at line 137 of file BombayTableIndex.hpp.
u32 cat::bombay::TableIndex::_used_elements [protected] |
Definition at line 139 of file BombayTableIndex.hpp.
const u64 cat::bombay::TableIndex::COLLIDE_MASK = ~OFFSET_MASK [static, protected] |
Definition at line 128 of file BombayTableIndex.hpp.
const u32 cat::bombay::TableIndex::COLLISION_INCREMENTER = 1017234223 [static, protected] |
Definition at line 125 of file BombayTableIndex.hpp.
const u32 cat::bombay::TableIndex::COLLISION_MULTIPLIER = 71*7487 * 4 + 1 [static, protected] |
Definition at line 124 of file BombayTableIndex.hpp.
const u32 cat::bombay::TableIndex::MIN_ELEMENTS = 1024 [static, protected] |
Definition at line 129 of file BombayTableIndex.hpp.
const u64 cat::bombay::TableIndex::OFFSET_MASK = (~(u64)0) >> 1 [static, protected] |
Definition at line 127 of file BombayTableIndex.hpp.
const u64 cat::bombay::TableIndex::TABLE_CHECK_HASH_SALT = 0x74B1301234DEADBE [static, protected] |
Definition at line 132 of file BombayTableIndex.hpp.
const u32 cat::bombay::TableIndex::TABLE_FOOTER_BYTES = 16 [static, protected] |
Definition at line 131 of file BombayTableIndex.hpp.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.