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

PLearn::Schema Class Reference

#include <SimpleDB.h>

Inheritance diagram for PLearn::Schema:

Inheritance graph
[legend]
Collaboration diagram for PLearn::Schema:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Schema ()
 -- Forwarding functions for base-class constructors

 Schema (size_type n, const T &value)
 Schema (int n, const T &value)
 Schema (long n, const T &value)
 Schema (size_type n)
 Schema (const Schema &x)
 Schema (const_iterator first, const_iterator last)
bool findColumn (const string &name, int &position, int &start, int &precision) const
 -- Additional functionality specific to Schema

FieldPtr findColumn (int position) const
 Make a pointer-to-field from a column number (zero-based).

FieldPtr findColumn (const string &name) const
 Make a pointer-to-field from a column name.

FieldPtr operator() (int position) const
FieldPtr operator() (const string &name) const

Private Types

typedef vector< Fieldinherited
typedef Field T

Detailed Description

A schema is essentially a vector of fields, with a few extensions to more easily find individual fields within the schema.

(Impl. note: we really should be using private inheritance here, but this is difficult to achieve since then every single function in the base class would have to be made visible through using-decl. In addition, special provisions would have to be hacked up for ensuring a smooth working of iterators. In any case, since we don't add any data member, an (accidental) destruction of a Schema by vector's destructor is in practice harmless.)

Definition at line 357 of file SimpleDB.h.


Member Typedef Documentation

typedef vector<Field> PLearn::Schema::inherited [private]
 

Definition at line 359 of file SimpleDB.h.

typedef Field PLearn::Schema::T [private]
 

Definition at line 360 of file SimpleDB.h.


Constructor & Destructor Documentation

PLearn::Schema::Schema  )  [inline]
 

-- Forwarding functions for base-class constructors

Definition at line 364 of file SimpleDB.h.

PLearn::Schema::Schema size_type  n,
const T value
[inline]
 

Definition at line 365 of file SimpleDB.h.

PLearn::Schema::Schema int  n,
const T value
[inline]
 

Definition at line 366 of file SimpleDB.h.

PLearn::Schema::Schema long  n,
const T value
[inline]
 

Definition at line 367 of file SimpleDB.h.

PLearn::Schema::Schema size_type  n  )  [inline, explicit]
 

Definition at line 368 of file SimpleDB.h.

PLearn::Schema::Schema const Schema x  )  [inline]
 

__STL_MEMBER_TEMPLATES

Definition at line 369 of file SimpleDB.h.

References x.

PLearn::Schema::Schema const_iterator  first,
const_iterator  last
[inline]
 

__STL_MEMBER_TEMPLATES

Definition at line 376 of file SimpleDB.h.


Member Function Documentation

FieldPtr PLearn::Schema::findColumn const string name  )  const
 

Make a pointer-to-field from a column name.

Definition at line 88 of file SimpleDB.cc.

References findColumn(), and PLERROR.

FieldPtr PLearn::Schema::findColumn int  position  )  const
 

Make a pointer-to-field from a column number (zero-based).

Definition at line 74 of file SimpleDB.cc.

References PLERROR.

bool PLearn::Schema::findColumn const string name,
int position,
int start,
int precision
const
 

-- Additional functionality specific to Schema

Find a schema entry ("column") by name, return true if found, and return to position, total bytes before in a row, and number of bytes in the column

Definition at line 59 of file SimpleDB.cc.

Referenced by PLearn::SimpleDB< KeyType, QueryResult >::findColumn(), findColumn(), and PLearn::RowIterator::makePtr().

FieldPtr PLearn::Schema::operator() const string name  )  const [inline]
 

Definition at line 405 of file SimpleDB.h.

References operator()().

FieldPtr PLearn::Schema::operator() int  position  )  const [inline]
 

For convenience, operator() on a string or an integer position return findColumn(). This does not conflict with any member inherited from vector<>

Definition at line 401 of file SimpleDB.h.

References operator()().

Referenced by operator()().


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