#include <LhxHashTable.h>
Inheritance diagram for LhxHashNodeAccessor:
Public Member Functions | |
LhxHashNodeAccessor () | |
LhxHashNodeAccessor (uint nextNodeOffsetInit) | |
Constructor for derived classes with fields before the next node pointer. | |
PBuffer | getCurrent () |
| |
void | setCurrent (PBuffer nodePtrInit) |
Set the current node pointer for this accessor. | |
void | reset () |
Reset the node pointer to NULL. | |
PBuffer | getBuffer () |
| |
PBuffer | getNext () |
| |
PBuffer | getNextLocation () |
| |
void | setNext (PBuffer nextNode) |
Set the next node pointer for node associated with this accessor. | |
void | setNext (PBuffer inputNode, PBuffer nextNode) |
Set the next node pointer for an input node. | |
uint | getNextFieldSize () |
| |
uint | getBufferOffset () |
| |
Private Attributes | |
uint | nextNodeOffset |
uint | nodeBufferOffset |
PBuffer | nodePtr |
The hash table class also has the ability to aggregate in place.
Definition at line 55 of file LhxHashTable.h.
LhxHashNodeAccessor::LhxHashNodeAccessor | ( | ) | [inline] |
Definition at line 1039 of file LhxHashTable.h.
References getNextFieldSize(), nextNodeOffset, and nodeBufferOffset.
01040 { 01041 nextNodeOffset = 0; 01042 nodeBufferOffset = nextNodeOffset + getNextFieldSize(); 01043 }
LhxHashNodeAccessor::LhxHashNodeAccessor | ( | uint | nextNodeOffsetInit | ) | [inline] |
Constructor for derived classes with fields before the next node pointer.
The idea is to store the variable length payload at the end.
[in] | nextNodeOffsetInit | offset to store the next node pointer. |
Definition at line 1045 of file LhxHashTable.h.
References getNextFieldSize(), nextNodeOffset, and nodeBufferOffset.
01046 { 01047 nextNodeOffset = nextNodeOffsetInit; 01048 nodeBufferOffset = nextNodeOffset + getNextFieldSize(); 01049 }
PBuffer LhxHashNodeAccessor::getCurrent | ( | ) | [inline] |
Definition at line 1051 of file LhxHashTable.h.
References nodePtr.
Referenced by LhxHashKeyAccessor::getFirstData(), LhxHashKeyAccessor::getNextSlot(), LhxHashBlockAccessor::getSlot(), LhxHashKeyAccessor::isMatched(), LhxHashKeyAccessor::setFirstData(), LhxHashKeyAccessor::setMatched(), and LhxHashKeyAccessor::setNextSlot().
01052 { 01053 return nodePtr; 01054 }
void LhxHashNodeAccessor::setCurrent | ( | PBuffer | nodePtrInit | ) | [inline] |
Set the current node pointer for this accessor.
[in] | nodePtrInit | pointer to node that will be associated with this accessor |
Definition at line 1061 of file LhxHashTable.h.
References nodePtr.
Referenced by reset(), LhxHashKeyAccessor::setCurrent(), LhxHashDataAccessor::setCurrent(), and LhxHashBlockAccessor::setCurrent().
01062 { 01063 nodePtr = nodePtrInit; 01064 }
void LhxHashNodeAccessor::reset | ( | ) | [inline] |
Reset the node pointer to NULL.
Reimplemented in LhxHashBlockAccessor.
Definition at line 1066 of file LhxHashTable.h.
References setCurrent().
Referenced by LhxHashTable::releaseResources(), and LhxHashBlockAccessor::reset().
01067 { 01068 setCurrent(NULL); 01069 }
PBuffer LhxHashNodeAccessor::getBuffer | ( | ) | [inline] |
Definition at line 1056 of file LhxHashTable.h.
References nodeBufferOffset, and nodePtr.
Referenced by LhxHashBlockAccessor::getSlot(), LhxHashDataAccessor::pack(), LhxHashKeyAccessor::pack(), LhxHashKeyAccessor::setCurrent(), LhxHashDataAccessor::setCurrent(), LhxHashBlockAccessor::setCurrent(), LhxHashKeyAccessor::unpack(), and LhxHashDataAccessor::unpack().
01057 { 01058 return (nodePtr + nodeBufferOffset); 01059 }
PBuffer LhxHashNodeAccessor::getNext | ( | ) | [inline] |
Definition at line 1071 of file LhxHashTable.h.
References nextNodeOffset, and nodePtr.
Referenced by LhxHashTableReader::advanceData(), LhxHashTableReader::advanceKey(), LhxHashTableReader::advanceSlot(), LhxHashTable::aggData(), LhxHashTable::allocateResources(), LhxHashTable::allocBuffer(), LhxHashTable::findKeyLocation(), and LhxHashTable::printSlot().
01072 { 01073 // REVIEW jvs 25-Aug-2006: Under what circumstances would 01074 // alignment be off? Tuple sizes are always aligned. Is it 01075 // because of the match indicator? If so, it might make sense to 01076 // fold that into the tuple. 01077 /* 01078 * nodePtr+nextNodeOffset might not be aligned so copy the pointer 01079 * value out. 01080 */ 01081 PBuffer returnPtr; 01082 memcpy((PBuffer)&returnPtr, nodePtr+nextNodeOffset, sizeof(PBuffer)); 01083 return returnPtr; 01084 }
PBuffer LhxHashNodeAccessor::getNextLocation | ( | ) | [inline] |
Definition at line 1086 of file LhxHashTable.h.
References nextNodeOffset, and nodePtr.
Referenced by LhxHashTable::findKeyLocation().
01087 { 01088 return nodePtr + nextNodeOffset; 01089 }
void LhxHashNodeAccessor::setNext | ( | PBuffer | nextNode | ) | [inline] |
Set the next node pointer for node associated with this accessor.
[in] | nextNode | pointer to the next node |
Definition at line 1091 of file LhxHashTable.h.
References getNextFieldSize(), nextNodeOffset, and nodePtr.
Referenced by LhxHashKeyAccessor::addData(), LhxHashTable::addKeyData(), LhxHashTable::aggData(), LhxHashTable::allocateResources(), LhxHashTable::allocBlock(), and LhxHashTable::allocBuffer().
01092 { 01093 memcpy(nodePtr+nextNodeOffset, (PBuffer)&nextNode, getNextFieldSize()); 01094 }
Set the next node pointer for an input node.
[in] | inputNode | input node to set the next node pointer |
[in] | nextNode | pointer to the next node |
Definition at line 1096 of file LhxHashTable.h.
References getNextFieldSize(), and nextNodeOffset.
01097 { 01098 memcpy(inputNode+nextNodeOffset, (PBuffer)&nextNode, getNextFieldSize()); 01099 }
uint LhxHashNodeAccessor::getNextFieldSize | ( | ) | [inline] |
Definition at line 1101 of file LhxHashTable.h.
Referenced by LhxHashNodeAccessor(), and setNext().
01102 { 01103 return sizeof(PBuffer); 01104 }
uint LhxHashNodeAccessor::getBufferOffset | ( | ) | [inline] |
This is equivalent to the total space used for the variable length payload.
Definition at line 1106 of file LhxHashTable.h.
References nodeBufferOffset.
Referenced by LhxHashKeyAccessor::getAvgStorageSize(), LhxHashDataAccessor::getAvgStorageSize(), LhxHashKeyAccessor::getStorageSize(), LhxHashDataAccessor::getStorageSize(), and LhxHashBlockAccessor::init().
01107 { 01108 return nodeBufferOffset; 01109 }
uint LhxHashNodeAccessor::nextNodeOffset [private] |
Definition at line 62 of file LhxHashTable.h.
Referenced by getNext(), getNextLocation(), LhxHashNodeAccessor(), and setNext().
uint LhxHashNodeAccessor::nodeBufferOffset [private] |
Definition at line 67 of file LhxHashTable.h.
Referenced by getBuffer(), getBufferOffset(), and LhxHashNodeAccessor().
PBuffer LhxHashNodeAccessor::nodePtr [private] |
Definition at line 72 of file LhxHashTable.h.
Referenced by getBuffer(), getCurrent(), getNext(), getNextLocation(), setCurrent(), and setNext().