Files Classes Functions Hierarchy
#include <bucketlink.h>
Public Member Functions | |
| bucketlink () | |
| Construct an empty link. | |
| bucketlink (T *data_) | |
| Construct with data. | |
| template<typename I2 > | |
| void | insertafterself (bucketlink< T > *b, I2 &fn) |
| Insert the link in the list in order. | |
Public Attributes | |
| T * | data |
| Hold the data. | |
| bucketlink * | next |
| The next link in the chain. | |
Static Public Attributes | |
| static uint | insertafterselfcounter = 0 |
| Set to zero before inserting, then you can compare after insertion to see the chain length. | |
Definition at line 22 of file bucketlink.h.
| bucketlink< T >::bucketlink | ( | ) | [inline] |
| bucketlink< T >::bucketlink | ( | T * | data_ | ) | [inline] |
| void bucketlink< T >::insertafterself | ( | bucketlink< T > * | b, | |
| I2 & | fn | |||
| ) | [inline] |
Insert the link in the list in order.
This routine can only insert after itself and not before.
Definition at line 61 of file bucketlink.h.
References bucketlink< T >::data, bucketlink< T >::insertafterselfcounter, bucketlink< T >::next, and SHOW.
Referenced by buckethybrid< T, HFN, C >::eval(), and bucket< T, HFN >::eval().
00062 { 00063 assert(b!=0); 00064 assert( fn(*(b->data),*(this->data))==false ); 00065 00066 insertafterselfcounter=0; 00067 00068 bucketlink<T>* cp = next; 00069 bucketlink<T>* cp0 = this; 00070 for ( ;cp!=0; ) 00071 { 00072 00073 ++insertafterselfcounter; 00074 #ifdef DEBUG_BUCKETLINK 00075 cout << SHOW(insertafterselfcounter) << endl; 00076 #endif 00077 00078 if (fn(*(b->data),*(cp->data))) 00079 { 00080 b->next = cp; 00081 cp0->next = b; 00082 return; 00083 } 00084 00085 cp0 = cp; 00086 cp = cp->next; 00087 } 00088 00089 // Insert at the end of the list. 00090 cp0->next = b; 00091 b->next=0; 00092 }
| T* bucketlink< T >::data |
Hold the data.
Definition at line 27 of file bucketlink.h.
Referenced by buckethybrid< T, HFN, C >::copy(), bucket< T, HFN >::copy(), buckethybrid< T, HFN, C >::eval(), bucket< T, HFN >::eval(), hashtable< T, HFN >::insert(), bucketlink< T >::insertafterself(), hashtable< T, HFN >::insertInverse(), buckethybrid< T, HFN, C >::move(), cfcontainerhash::operator()(), cfcontainerhash::operator[](), and hashtable< T, HFN >::remove().
uint bucketlink< T >::insertafterselfcounter = 0 [inline, static] |
Set to zero before inserting, then you can compare after insertion to see the chain length.
Definition at line 43 of file bucketlink.h.
Referenced by bucketlink< T >::insertafterself().
| bucketlink* bucketlink< T >::next |
The next link in the chain.
Definition at line 30 of file bucketlink.h.
Referenced by buckethybrid< T, HFN, C >::copy(), bucket< T, HFN >::copy(), buckethybrid< T, HFN, C >::eval(), bucket< T, HFN >::eval(), hashtable< T, HFN >::insert(), bucketlink< T >::insertafterself(), hashtable< T, HFN >::insertInverse(), buckethybrid< T, HFN, C >::move(), and hashtable< T, HFN >::remove().
1.5.8