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

PLearn::SDBVMatrix Class Reference

#include <SDBVMat.h>

Inheritance diagram for PLearn::SDBVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SDBVMatrix (const string &dbname, bool detect_missing=false)
 Currently, the constructor assumes that the SDB exists on-disk.

void appendField (const string &name, SDBVMField *new_field)
 Add a new field to the VMatrix.

const FieldsVectorgetFields () const
 Obtain a list of the added fields.

virtual void getRow (int i, Vec v) const
 Transform row i of the SimpldDB into a row of the VMatrix.

SDBWithStatssdb ()
 Access underlying sdb.

const SDBWithStatssdb () const

Protected Attributes

SDBWithStats sdb_
FieldsVector fields_
Row row_
bool detect_missing_

Private Types

typedef RowBufferedVMatrix inherited
typedef vector< PSDBVMFieldFieldsVector

Detailed Description

This is a VMatrix that acts as a front-end to a SimpleDB (actually, an SDBWithStats). You can add as many fields derived from SDBVMField as required with the appendField function.

Definition at line 251 of file SDBVMat.h.


Member Typedef Documentation

typedef vector<PSDBVMField> PLearn::SDBVMatrix::FieldsVector [private]
 

Definition at line 254 of file SDBVMat.h.

typedef RowBufferedVMatrix PLearn::SDBVMatrix::inherited [private]
 

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 253 of file SDBVMat.h.


Constructor & Destructor Documentation

PLearn::SDBVMatrix::SDBVMatrix const string dbname,
bool  detect_missing = false
 

Currently, the constructor assumes that the SDB exists on-disk.

Definition at line 216 of file SDBVMat.cc.

References PLearn::SDBWithStats::computeStats(), PLearn::SimpleDB< KeyType, QueryResult >::getSchema(), PLearn::SDBWithStats::hasStats(), PLearn::SDBWithStats::loadStats(), row_, PLearn::SDBWithStats::saveStats(), PLearn::SDB, sdb_, and PLearn::SimpleDB< KeyType, QueryResult >::size().


Member Function Documentation

void PLearn::SDBVMatrix::appendField const string name,
SDBVMField new_field
 

Add a new field to the VMatrix.

The VMatrix assumes ownership of the field.

Definition at line 230 of file SDBVMat.cc.

References fields_, PLearn::SDBVMField::fieldType(), PLearn::SDBVMField::fieldWidth(), k, PLearn::PSDBVMField, PLearn::TVec< T >::resize(), and PLearn::split().

const FieldsVector& PLearn::SDBVMatrix::getFields  )  const [inline]
 

Obtain a list of the added fields.

Definition at line 267 of file SDBVMat.h.

void PLearn::SDBVMatrix::getRow int  i,
Vec  v
const [virtual]
 

Transform row i of the SimpldDB into a row of the VMatrix.

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 255 of file SDBVMat.cc.

References detect_missing_, fields_, PLearn::SimpleDB< KeyType, QueryResult >::getInRow(), PLearn::TVec< T >::hasMissing(), PLWARNING, row_, sdb_, and PLearn::TVec< T >::subVec().

const SDBWithStats& PLearn::SDBVMatrix::sdb  )  const [inline]
 

Definition at line 278 of file SDBVMat.h.

SDBWithStats& PLearn::SDBVMatrix::sdb  )  [inline]
 

Access underlying sdb.

Definition at line 275 of file SDBVMat.h.


Member Data Documentation

bool PLearn::SDBVMatrix::detect_missing_ [protected]
 

Definition at line 286 of file SDBVMat.h.

Referenced by getRow().

FieldsVector PLearn::SDBVMatrix::fields_ [protected]
 

Definition at line 284 of file SDBVMat.h.

Referenced by appendField(), and getRow().

Row PLearn::SDBVMatrix::row_ [mutable, protected]
 

Definition at line 285 of file SDBVMat.h.

Referenced by getRow(), and SDBVMatrix().

SDBWithStats PLearn::SDBVMatrix::sdb_ [protected]
 

Definition at line 283 of file SDBVMat.h.

Referenced by getRow(), and SDBVMatrix().


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