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

PLearn::FieldPtr Class Reference

#include <SimpleDB.h>

Collaboration diagram for PLearn::FieldPtr:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FieldPtr ()
 The default ctor makes a "null" field ptr.

int field_index () const
 Using default copy ctor, dtor, and operator= Useful accessors.

ptrdiff_t offset () const
 operator bool () const
 Conversion to bool: true if pointer is non-null.

bool operator! () const
 Negation: true if pointer is null.

bool operator== (const FieldPtr &x) const
 Comparison operators.

bool operator!= (const FieldPtr &x) const

Private Member Functions

 FieldPtr (int fi, ptrdiff_t o)
 For use by Schema and Row::iterator.


Private Attributes

int field_index_
 field number in schema

ptrdiff_t offset_
 actual byte offset_into row


Detailed Description

A FieldPtr is like a pointer-to-member in C++: it represents the abstract location of a single field within a Row. The operation of binding a FieldPtr with a Row, yielding a Row::iterator is very fast.

It is an error to bind a pointer created w.r.t. given schema to a row using an incompatible schema, although this is not checked for it would be prohibitively expensive (it's more complex than just checking a schema pointer).

Definition at line 180 of file SimpleDB.h.


Constructor & Destructor Documentation

PLearn::FieldPtr::FieldPtr  )  [inline]
 

The default ctor makes a "null" field ptr.

Definition at line 186 of file SimpleDB.h.

References field_index_, and offset_.

PLearn::FieldPtr::FieldPtr int  fi,
ptrdiff_t  o
[inline, private]
 

For use by Schema and Row::iterator.

Definition at line 221 of file SimpleDB.h.

References field_index_, and offset_.


Member Function Documentation

int PLearn::FieldPtr::field_index  )  const [inline]
 

Using default copy ctor, dtor, and operator= Useful accessors.

Definition at line 191 of file SimpleDB.h.

References field_index_.

Referenced by PLearn::SDBVMSource::getFieldStat().

ptrdiff_t PLearn::FieldPtr::offset  )  const [inline]
 

Definition at line 195 of file SimpleDB.h.

References offset_.

PLearn::FieldPtr::operator bool  )  const [inline]
 

Conversion to bool: true if pointer is non-null.

Definition at line 200 of file SimpleDB.h.

References field_index_.

bool PLearn::FieldPtr::operator!  )  const [inline]
 

Negation: true if pointer is null.

Definition at line 205 of file SimpleDB.h.

References field_index_.

bool PLearn::FieldPtr::operator!= const FieldPtr x  )  const [inline]
 

Definition at line 215 of file SimpleDB.h.

References x.

bool PLearn::FieldPtr::operator== const FieldPtr x  )  const [inline]
 

Comparison operators.

Definition at line 210 of file SimpleDB.h.

References field_index_, offset_, and x.


Member Data Documentation

int PLearn::FieldPtr::field_index_ [private]
 

field number in schema

Definition at line 224 of file SimpleDB.h.

Referenced by PLearn::Row::bind(), field_index(), FieldPtr(), operator bool(), operator!(), and operator==().

ptrdiff_t PLearn::FieldPtr::offset_ [private]
 

actual byte offset_into row

Definition at line 225 of file SimpleDB.h.

Referenced by PLearn::Row::bind(), FieldPtr(), offset(), and operator==().


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