Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::SimpleDBIndexKey< KeyType > Class Template Reference

#include <SimpleDB.h>

Collaboration diagram for PLearn::SimpleDBIndexKey< KeyType >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef KeyType ByteArr
typedef ByteArr::iterator iterator

Public Member Functions

 SimpleDBIndexKey ()
 default ctor

 SimpleDBIndexKey (size_t len)
 SimpleDBIndexKey (const unsigned char *the_raw, size_t len)
 SimpleDBIndexKey (const ByteArr &the_raw)
 operator char * () const
size_t byteLength () const
bool operator== (const SimpleDBIndexKey &other) const
 relational operators

bool operator!= (const SimpleDBIndexKey &other) const
void resize (size_t len)
ByteArr::iterator begin ()
ByteArr::iterator end ()

Private Attributes

ByteArr raw

Detailed Description

template<class KeyType>
class PLearn::SimpleDBIndexKey< KeyType >

An IndexKey is used by hash tables for indexing purposes. It contains* a tiny vector of bytes (cannot be a pointer onto a row, since full row objects are fairly short-lived).

Definition at line 420 of file SimpleDB.h.


Member Typedef Documentation

template<class KeyType>
typedef KeyType PLearn::SimpleDBIndexKey< KeyType >::ByteArr
 

These is a small semantic clash between what Hash requires and the way database rows are implemented. According to the C++ standard, the only type that is guaranteed to map to any preconceived notion of "amorphous byte" is the unsigned char (assuming 8-bit chars). Hence, all our internal data storage is performed this way. However, Hash works with plain chars, which causes a somewhat annoying compiler complaint of possible conversion error. This is why you see the static_cast in operator char*().

Definition at line 432 of file SimpleDB.h.

template<class KeyType>
typedef ByteArr::iterator PLearn::SimpleDBIndexKey< KeyType >::iterator
 

Definition at line 433 of file SimpleDB.h.


Constructor & Destructor Documentation

template<class KeyType>
PLearn::SimpleDBIndexKey< KeyType >::SimpleDBIndexKey  )  [inline]
 

default ctor

Definition at line 435 of file SimpleDB.h.

template<class KeyType>
PLearn::SimpleDBIndexKey< KeyType >::SimpleDBIndexKey size_t  len  )  [inline, explicit]
 

Definition at line 437 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
PLearn::SimpleDBIndexKey< KeyType >::SimpleDBIndexKey const unsigned char *  the_raw,
size_t  len
[inline]
 

Definition at line 440 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::begin(), std::copy(), and PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
PLearn::SimpleDBIndexKey< KeyType >::SimpleDBIndexKey const ByteArr the_raw  )  [inline]
 

Definition at line 446 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.


Member Function Documentation

template<class KeyType>
ByteArr::iterator PLearn::SimpleDBIndexKey< KeyType >::begin  )  [inline]
 

Definition at line 480 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

Referenced by PLearn::SimpleDB< KeyType, QueryResult >::findEqualLinear(), PLearn::SimpleDB< KeyType, QueryResult >::indexColumn(), and PLearn::SimpleDBIndexKey< KeyType >::SimpleDBIndexKey().

template<class KeyType>
size_t PLearn::SimpleDBIndexKey< KeyType >::byteLength  )  const [inline]
 

Definition at line 463 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
ByteArr::iterator PLearn::SimpleDBIndexKey< KeyType >::end  )  [inline]
 

Definition at line 484 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
PLearn::SimpleDBIndexKey< KeyType >::operator char *  )  const [inline]
 

REquired interface. There is one small thing that our dear Hash Table class does not account for: operator char*() MUST BE CONST! or otherwise, the conversion operator is not called properly.

Definition at line 459 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
bool PLearn::SimpleDBIndexKey< KeyType >::operator!= const SimpleDBIndexKey< KeyType > &  other  )  const [inline]
 

Definition at line 472 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
bool PLearn::SimpleDBIndexKey< KeyType >::operator== const SimpleDBIndexKey< KeyType > &  other  )  const [inline]
 

relational operators

Definition at line 468 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.

template<class KeyType>
void PLearn::SimpleDBIndexKey< KeyType >::resize size_t  len  )  [inline]
 

Definition at line 476 of file SimpleDB.h.

References PLearn::SimpleDBIndexKey< KeyType >::raw.


Member Data Documentation

template<class KeyType>
ByteArr PLearn::SimpleDBIndexKey< KeyType >::raw [private]
 

Definition at line 489 of file SimpleDB.h.

Referenced by PLearn::SimpleDBIndexKey< KeyType >::begin(), PLearn::SimpleDBIndexKey< KeyType >::byteLength(), PLearn::SimpleDBIndexKey< KeyType >::end(), PLearn::SimpleDBIndexKey< KeyType >::operator char *(), PLearn::SimpleDBIndexKey< KeyType >::operator!=(), PLearn::SimpleDBIndexKey< KeyType >::operator==(), PLearn::SimpleDBIndexKey< KeyType >::resize(), and PLearn::SimpleDBIndexKey< KeyType >::SimpleDBIndexKey().


The documentation for this class was generated from the following file:
Generated on Tue Aug 17 16:23:03 2004 for PLearn by doxygen 1.3.7